If I have an empty while loop in my code such as:
while(true);
It will drive the processor usage up to about 25%. However if I do the followin
Because you're keeping the processor busy evaluating the loop over annd over.
Using Sleep actually lets other threads execute on the CPU and along with a very short context switch looks as if the CPU is free for a short while.