Skip to content

Commit

Permalink
Simplified the avg_frames_per_sec formula
Browse files Browse the repository at this point in the history
  • Loading branch information
zsolt-donca committed Mar 4, 2021
1 parent c4daa8c commit e76a646
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/screencast/fps_limit.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,7 @@ void measure_fps(struct fps_limit_state *state, struct timespec *now) {
return;
}

double avg_delay_sec = elapsed_sec / state->fps_frame_count;
double avg_frames_per_sec = 1.0 / avg_delay_sec;
double avg_frames_per_sec = state->fps_frame_count / elapsed_sec;

logprint(DEBUG, "fps_limit: average FPS in the last %0.0f seconds: %0.2f",
FPS_MEASURE_PERIOD_SEC, avg_frames_per_sec);
Expand Down

0 comments on commit e76a646

Please sign in to comment.