Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

(zdog) RE: (2) The Best Infinite Loop

by zdog (Priest)
on Oct 18, 2000 at 01:51 UTC ( #37238=note: print w/ replies, xml ) Need Help??

in reply to RE: The Best Infinite Loop
in thread The Best Infinite Loop

I never realized that while() could be used as an infinite loop, so I went and benchmarked it up against for (;;) and I got these results:

Benchmark: timing 20000 iterations of for, while()... for: 45 wallclock secs (43.95 usr + 0.00 sys = 43.95 CPU) @ 45 +5.06/s (n=20000) while(): 43 wallclock secs (43.28 usr + 0.00 sys = 43.28 CPU) @ 46 +2.11/s (n=20000)

Note: Do not be alarmed if it took longer this time than in the above post, I did it on a slower computer.

Sooo..., I guess you were right!!

Zenon Zabinski | zdog |

Comment on (zdog) RE: (2) The Best Infinite Loop
Select or Download Code

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://37238]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (6)
As of 2015-10-08 21:23 GMT
Find Nodes?
    Voting Booth?

    Does Humor Belong in Programming?

    Results (228 votes), past polls