Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

What is the most suitable solution for running a timer every 40 msec?

0
Posted

What is the most suitable solution for running a timer every 40 msec?

0

A. John M. Drescher quoted :- The problem is that the time slice is much larger than 1 ms. See this article: Time is the Simplest Thing… Antti Keskinen quoted :- Windows is not the best platform for time-critical applications. If you must use it, though, you could try increasing the priority of your application to maximum level. This ensures that the 40 ms (I assume milliseconds, here) timer is fired as close to 40 ms intervals as possible. Increasing the priority of your application will cause other applications to lose theirs: increasing the accuracy of your application might/will cause inaccuracy/stiff response/high latency in other applications concurrently executing in the system. Pushing one application to real-time priority will most likely cause the operating system to appear ‘locked up’ while this single application is executing. The timer will reach as close to 40 ms intervals as possible, though. That’s the price you’ll have to pay. When designing the real-time thread, you

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123