CPU usage spiking

M

mmitchell

I have a statement as: Thread.CurrentThread.Sleep(1000 * 10), which
spikes CPU usage from 17% to 65%. I thought this was supposed to bring
the CPU usage down.

How else would I pause a thread without raising the CPU usage up?
 
M

mmitchell

I found it was a do loop causing the spike. I added:
Thread.CurrentThread.Sleep(100) inside the Do Loop and the CPU usage
dropped to 0-2%.
 
H

Herfried K. Wagner [MVP]

I have a statement as: Thread.CurrentThread.Sleep(1000 * 10), which
spikes CPU usage from 17% to 65%. I thought this was supposed to bring
the CPU usage down.

Mhm... Try 'System.Threading.Thread.Sleep(100000)'.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top