That code is for compensating for frametimes when the timer runs, say you set the interval to 100 ms and a frame takes 110 ms then that row tells that next frame just shall take 90ms to get a average of 100ms/frame.

The bug is aperantly when you set the interval to a value below the max fps of the program (ex if 100 fps in app when inteval = 0 then max interval is 10 (1000ms / 100 fps)).

I'm currently working on a solution to the problem.

You might want to comment the line for now. Then the timer works as the one in the prew version.