Can someone explain difference between dispatchTimer.Interval and real time?

36 views Asked by At
dispatcherTimer = new DispatcherTimer(DispatcherPriority.Normal); // or .Release
dispatcherTimer.Tick += f;
dispatcherTimer.Interval = TimeSpan.FromMilliseconds(x);


 x => real time
11 => 15.9 ms
12 => 15.9 ms
13 => 17 ms
16 => 25 ms

Above measurements are taken with different combinations of DispatcherPriority.Render and DispatcherPriority.Normal, Debug build and release. Results are almost identical.
f is fired on average every 25ms for x = 16. Why?

I have read MS explanation:

Remarks
Timers are not guaranteed to execute exactly when the time interval occurs, but they are guaranteed to not execute before the time interval occurs.

But that doesn't explain time shift or 11 => 15.9 or 16 => 25.

0

There are 0 answers