How to call a timer function every 50ms exactly?

When I call timer.performWithDelay() like this: (with FPS set to 60)

timer.performWithDelay(50, onTimer, 0)

I found onTimer() is called every 66ms approximately. I figure it is because when FPS is 60, each frame is called every

1000/60 = 16.67 ms

Hence, when I set the timer to 50ms, there must be 4 frames passed in order to pass 50ms, so it is about 

16.67 * 4 = 66.68 ms

Is there any way to make exact 50ms case happen? (I know the delay might fluctuate a bit, but right now I only know the delay has to be something close to the multiply of 1000/60).

You’re right about the fluctuation and no, you can’t guarantee that the timer will be called exactly when you specify. I think the docs says that the time period is “not before”, and that pretty much applies to any timer in any system.

You’re right about the fluctuation and no, you can’t guarantee that the timer will be called exactly when you specify. I think the docs says that the time period is “not before”, and that pretty much applies to any timer in any system.