Hi,
first look what I mean with Sleep and MySleep.
Sleep:
[code]
System.Threading.Thread.Sleep(5000);
[/code]
MySleep:
[code]
DateTime DT = DateTime.Now;
while (((TimeSpan)(DateTime.Now - DT)).TotalMilliseconds < 5000) ;
[/code]
If you use Sleep, you will see no CPU-Usage-Maximum in the TaskManager.
But if you use MySleep, the CPU will reach a usage max. I understand why MySleep use the CPU, but why does Sleep don't?
How does Sleep sleep?
Comments
:
Thx for this. My thirst for knowledge is satisfied.