Skip to content

Commit

Permalink
turn off fps logging for release builds
Browse files Browse the repository at this point in the history
  • Loading branch information
jayrave committed Jun 13, 2020
1 parent 9316cbd commit f403b36
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions frontend_utils/src/fps.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ impl Fps {
}
}

#[cfg(debug_assertions)]
pub fn track(&mut self) {
self.frame_count_in_window += 1;
let now = Instant::now();
Expand All @@ -27,4 +28,9 @@ impl Fps {
self.window_start = now;
}
}

#[cfg(not(debug_assertions))]
pub fn track(&mut self) {
// It is a no-op when no debugging is requested
}
}

0 comments on commit f403b36

Please sign in to comment.