What would be the best way to break out of a loop in a timely manner, after a few secs for example. ( I dont need exactitude.)
I know about the GetTickCount() method but i think it would be least CPU intensive to just increment and check against an integer.

Is there a better way?

Code:
size_t i=0;

while (1)
{
            i++;
            // Do something again and again...

            // ... and now break out.
            if (i > 99)
            {
                return;
            }
 }