simpler and better implementation of timer based on frame rates