CPU usage spiking

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • mmitchell@capstonetechnology.com

    CPU usage spiking

    I have a statement as: Thread.CurrentT hread.Sleep(100 0 * 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?

  • mmitchell@capstonetechnology.com

    #2
    Re: CPU usage spiking

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

    Comment

    • Herfried K. Wagner [MVP]

      #3
      Re: CPU usage spiking

      <mmitchell@caps tonetechnology. com> schrieb:[color=blue]
      >I have a statement as: Thread.CurrentT hread.Sleep(100 0 * 10), which
      > spikes CPU usage from 17% to 65%. I thought this was supposed to bring
      > the CPU usage down.[/color]

      Mhm... Try 'System.Threadi ng.Thread.Sleep (100000)'.

      --
      M S Herfried K. Wagner
      M V P <URL:http://dotnet.mvps.org/>
      V B <URL:http://classicvb.org/petition/>

      Comment

      Working...