Thread: Infinite loops
View Single Post
Author Message
Pro Patria Finland
Senior Member
Join Date: Apr 2006
Location: BaronPub.com
Old 02-12-2009 , 13:57   Infinite loops
Reply With Quote #1

An interesting question occured somewhere, I am not even sure if this question makes sense. Anywho, does anyone know which of these is the fastest one to execute, to make an infinite loop (in C++)?

Code:
while(1)
{

}
Code:
for(;;)
{

}
Code:
hello:

goto hello;
It doesn't matter what's inside the loop, just what of those is the fastest one to execute.
__________________
I am not a number. I am Gordon Freeman!
Pro Patria Finland is offline