On Feb 17, 2007, at 2:12 AM, Jeffrey Ellis wrote:

On an entirely different subject -- the database thing having to go on hold till next week now, I have the following code in a thread. All it's supposed to do is display the current date/time, and continually update as a clock.

  While val(Format(d.totalseconds,
"##########"))<val(Format(theDate.totalseconds, "##########"))
    d=new date
    window1.currenttime.text=d.shortdate+" "+d.longtime
  Wend

When run, I see this little app is hogging a major chunk of CPU. It's at nearly 50% of CPU on average, 17.1 MB of real ram, and more than 120 MB of
VM!

What's going on... Or more to the point, what am I doing wrong?

This runs all the time up until the stop time (theDate) is reached and so it will suck up a lot of CPU whether it's in a thread or not

Try making it sleep a tiny little bit in between each update of the clock

Look up SleepCurrentThread

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to