Re:Which is faster? while(1) {} or while(2) {}
by vinkelhake on Monday July 21, 2014 @11:05AM
(#8064016)
The question can be interpreted in different ways. For example: (1) "Which of these infinite takes the longest to run to completion?". Another interpretation could be: (2) "We want to write an infinite loop, which of these two ends up with the most efficient code?".
I don't think anyone is missing the point that an infinite loop takes infinite time to terminate, it's just not a very interesting point to make. Getting "hung up" on (1) means missing out on potentially interesting insights found when answering (2).
I don't think anyone is missing the point that an infinite loop takes infinite time to terminate, it's just not a very interesting point to make. Getting "hung up" on (1) means missing out on potentially interesting insights found when answering (2).