Greetings,
I am a rather new developer of threaded programs in VB.net. Currently my job is having me program a high speed serialized program. One requirement is being able to handle data at a very fast rate, while maintaining accuracy of thread timing.
In attempting to use Windows Timers, I find their accuracy to be poor (55ms or so). I downloaded several custom timers with microsecond accuracy, but unfortunately none of them give handles to tick events. They are just timer.stat, timer.stop, timer.getelapsed - wheras forms/system timers have a tick property and elapsed event.
So I have a while(running) loop to check my timers. Like all thread loops, I need to sleep the thread before looping to ensure I give up the CPU for a bit. Otherwise the 1 looping thread pegs the CPU at ~100%. I need something more accurate than the Millisecond sleep .NET provides.
So, does a Microsecond sleep function exist for VB.net?
I know Linux, Unix, and various C++ libraries have uSleep available. At least, I found some references to them when Googling. Thank you for any help you can provide me with.
I am a rather new developer of threaded programs in VB.net. Currently my job is having me program a high speed serialized program. One requirement is being able to handle data at a very fast rate, while maintaining accuracy of thread timing.
In attempting to use Windows Timers, I find their accuracy to be poor (55ms or so). I downloaded several custom timers with microsecond accuracy, but unfortunately none of them give handles to tick events. They are just timer.stat, timer.stop, timer.getelapsed - wheras forms/system timers have a tick property and elapsed event.
So I have a while(running) loop to check my timers. Like all thread loops, I need to sleep the thread before looping to ensure I give up the CPU for a bit. Otherwise the 1 looping thread pegs the CPU at ~100%. I need something more accurate than the Millisecond sleep .NET provides.
So, does a Microsecond sleep function exist for VB.net?
I know Linux, Unix, and various C++ libraries have uSleep available. At least, I found some references to them when Googling. Thank you for any help you can provide me with.