Refactor update_frame_time/limit_frame_time