Improved DoEvents For NT Users

DoEvents was great to keep a tight process from hogging the system, but in NT 4.0 if you check you'll find your cpu usage going to 100 percent quick. Try adding a line with Sleep 1 after DoEvents to your tight loops, this will only cost you 1 ms and if you just call the sleep command every 150 or 200 passes, it doesn't cost you much. On my PC the procedure below shows 1% or less change to my cpu usage. If you Rem out the sleep line cpu usage hits 100% quick.Click Here for the Code

Hide comments


  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.