The Timer component is not accurate enough, is there an alternative?

I need the event to occur every 0.03125 s. The Timer control can only take a value of 0.031 s.

How can I create an event from Stopwatch more accurate component?

+2
c # visual-studio-2008 winforms
source share
5 answers

I found this, it is much more accurate and reliable than the standard timer! I do not believe in that.

http://www.codeproject.com/Articles/5501/The-Multimedia-Timer-for-the-NET-Framework

To quote: Win32 multimedia timer services provide maximum synchronization accuracy. They allow you to schedule higher resolution synchronization events than other timer services. This can be useful in a multimedia application where timing accuracy is paramount. For example, a MIDI application requires temporary events that are as small as possible.

Unfortunately, the Win32 multimedia timer is not part of the .NET Framework. However, using .NET interoperability services, a multimedia timer can be entered into the .NET folder.

+3
source share

Windows is not a real-time operating system, so you cannot get such a guarantee that the method will be executed after a certain time.

The best you can do is wait for a time check (possibly with a stopwatch).

You can also use Multimedia timers with better resolution ... (search query - C # multimedia timers , i.e. Getting exact ticks from a timer in C # )

+2
source share

Timers, as a rule, will be accurate within about 15 ms, and even then, as a rule, problems with accuracy arise, since they usually receive preliminary emission.

Having a timer with a precision specified in a quarter of a millisecond range will require a real-time operating system and probably will not work properly, regardless of which timer is used.

+2
source share

'I need an event to occur every 0.03125 s' - to reliably achieve this accuracy, use a dedicated microcontroller.

You cannot achieve what you need on the desktop OS.

+2
source share

How about a high priority flow and cycle with an hourly stopwatch or more accurate counter?

+1
source share

All Articles