Click here to Skip to main content
15,889,462 members
Articles / Desktop Programming / WPF

Improving the WPF DispatcherTimer Precision

Rate me:
Please Sign up or sign in to vote.
5.00/5 (6 votes)
3 Feb 2022Public Domain4 min read 11.8K   121   10  
How to correct the problem that the DispatcherTimer raises the Tick events slower than required by Interval
WPF uses the DispatcherTimer to raise the Tick. The time between 2 ticks should always be the same, defined by DispatcherTimer.Interval. The advantage of using the DispatcherTimer is that the event is raised on the WPF thread. The disadvantage is that the WPF threat has also other things to do, which might take hundreds of milliseconds. If Interval is 1 second or shorter, the ticks are raised slower than as they should be. This article explains how changing the interval tick by tick can improve the regularity of the ticks.

Views

Daily Counts

Downloads

Weekly Counts

License

This article, along with any associated source code and files, is licensed under A Public Domain dedication


Written By
Software Developer (Senior)
Singapore Singapore
Retired SW Developer from Switzerland living in Singapore

Interested in WPF projects.

Comments and Discussions