Multimedia-Timer
Multimedia-Timer copied to clipboard
interval is overriden in ctor
The pivate Initialize() sets the private field period to Capabilities.PeriodMin.
Calling Start() afterwards gives a timer which fires its events at the wrong rate.
Hi @7mPx - Sorry for the extremely delayed response, but I'm now using the code. :)
I'm not sure this is causing a problem. I was able to get it successfully working with this.
Asking for a 250 ms event rate, I just dropped some simple debug statements with the current time and found elapsed times that looked like this (all times in elapsed milliseconds):
250.041 250.41 249.454 250.169 250.007 250.468 249.541 250.075 249.95 249.921 250.728 249.933 249.246 249.935 250.086 249.982 250.309 249.694 250.85 249.358 249.888 250.727 249.982 249.134 250.364 249.931 250.544 249.893 249.648 249.675 249.992
One note, though - the example on the readme here led me astray initially. It shows code setting the resolution of the timer. I initially set my resolution to 250 milliseconds and just assumed that resolution was the amount of time between the callback getting fired - it's not.
After I realized that it's the interval property that does that, I just changed my code to set that to 250 and all was goodness.