FPS clock fix.

* Resetting the counter makes the FPS count jump up.
This commit is contained in:
iabdalkader 2020-06-08 00:02:22 +02:00
parent 45e7f055ec
commit 4dec480f83

View File

@ -33,11 +33,6 @@ mp_obj_t py_clock_fps(mp_obj_t clock_obj)
clock->t_frame++;
clock->t_ticks += (systick_current_millis()-clock->t_start);
float fps = 1000.0f / (clock->t_ticks/(float)clock->t_frame);
if (clock->t_ticks >= 2000) {
// Reset the FPS clock every 2s
clock->t_frame = 0;
clock->t_ticks = 0;
}
return mp_obj_new_float(fps);
}