I guess what I said was wrong, sorry everyone. I recall reading a tutorial about it some years ago and I could swear this should work I also run a test just now, and sleep(0) doesn't reduce the CPU last... At least not with Vista and .NET 2.0 What it does instead, is trigger the execution of waiting threads, thus allowing better CPU utilization. Sleep(0) is something like "I am ready for now, you should take care of others". This is pretty useless however, if your application is the only one running
My tests were run on an empty loop, I am not sure if it will behave the same in a 3D demo.
I also tried Sleep(1), but that reduced my performance by factor of 3. Hoverer, this is an empty loop... Humus, if you have some spare time, could you probably try Sleep(1) in your demo and tell us the result? I am eager to know how it will reduce the performance.
Sleep(0) : A value of zero causes the thread to relinquish the remainder of its time slice to any other thread of equal priority that is ready to run. If there are no other threads of equal priority ready to run, the function returns immediately, and the thread continues execution. (MSDN)
Sleep(1) will wait for 1millisec each time it is being called etc
Since you're programming you cannot not know how this affects performace in any given app... ?! right ..?