Why is timer object firing at an incorrect frame rate?
6 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I am using a timer object to try to enforce a frame rate of 25 Hz (0.04 seconds per period) for a few minutes. When I use tic/toc to see how long each 25-frame "second" takes, it is not one second. The time-per-second depends on what I have running in the TimerFcn. I have seen a string of 1.1-second "seconds", and other times there are strings of 0.92-second "seconds".
I am confused because when I use the "AveragePeriod" method, the timer always thinks it has perfect timing, and has an average period of 0.04 seconds. Even if the actual periods seem to be 10% off. Does the timer use a completely different system than the tic/toc functions?
I am running it in 'FixedRate' mode, so it should run the TimerFcn every 0.04 seconds. I have tried it with both 'drop' and 'queue' options for the BusyAction.
3 Kommentare
Antworten (0)
Siehe auch
Kategorien
Mehr zu Entering Commands finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!