Skip to content

Commit b0ace6e

Browse files
committed
Fix for divide by zero
1 parent 9ddb173 commit b0ace6e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libs/openFrameworks/utils/ofFpsCounter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ void ofFpsCounter::update(time_point<steady_clock> now){
5050
return;
5151
}
5252
diff = now - timestamps.front();
53-
if (diff > 0.0s) {
53+
if (std::chrono::duration<double>(diff).count() > 0.0) {
5454
fps = static_cast<double>(timestamps.size()) / std::chrono::duration<double>(diff).count();
5555
} else {
5656
fps = timestamps.size();

0 commit comments

Comments
 (0)