C
cgchris99
Guest
I have a app that I am writing. I launches a couple threads that run
constantly. I have a timer in the thread to indicate how fast it is
executing a loop. I need this loop to be FAST. It must be 5ms or less. If
I put "thread.currentthread.priority.sleep(1)", the loop time is about 15ms.
This is on a 2Ghz PC with 1024MB Ram. If I completely remove the sleep, it
executes the loop in 0.013 ms. Yes, that's milliseconds.
Ideally, I would like a happy medium of about 3-5ms scan time would be
great. But the sleep command does not allow anything but an integer,
sleep(0.5) produces the same as no sleep command. The only reason I ask is
that I have other threads running and would like to give up some processing
to the others during the "sleep" time. If I put application.doevents
instead of sleep, the scan time fluctuates a lot. From 0.013 - 110ms.
Thanks for any advice
constantly. I have a timer in the thread to indicate how fast it is
executing a loop. I need this loop to be FAST. It must be 5ms or less. If
I put "thread.currentthread.priority.sleep(1)", the loop time is about 15ms.
This is on a 2Ghz PC with 1024MB Ram. If I completely remove the sleep, it
executes the loop in 0.013 ms. Yes, that's milliseconds.
Ideally, I would like a happy medium of about 3-5ms scan time would be
great. But the sleep command does not allow anything but an integer,
sleep(0.5) produces the same as no sleep command. The only reason I ask is
that I have other threads running and would like to give up some processing
to the others during the "sleep" time. If I put application.doevents
instead of sleep, the scan time fluctuates a lot. From 0.013 - 110ms.
Thanks for any advice