Is 0.00722599029541 seconds really a long time?
It is if you need to iterate through the loop enough times!
However, I don't concern myself with how long things take until they take "too long". At that point, I look to see why they are taking so long and what we can do about it.
| [reply] |
It is if you need to iterate through the loop enough times!
How do you figure that?
If you're going to loop a million times, it's still only takes 0.0007 s cumulatively. It will only add up to 7 s if you do a billion passes of the loop. If you're doing something a billion times in Perl, it's going to take an hour, a day, or more. An extra 7 s isn't going to matter. This is the point where you offload the work to C or something, not move a my.
| [reply] [d/l] |
Doesn't seem like a long time, but I've always been curious about this. I suppose in some scenarios it could be beneficial to declare the my variable outside the loop. | [reply] |
| [reply] [d/l] |