mirror of https://github.com/mgba-emu/mgba.git
Qt: Better fps non-zero division check
This commit is contained in:
parent
f45b4e3ef0
commit
001135ef91
|
@ -1138,14 +1138,14 @@ void Window::recordFrame() {
|
|||
}
|
||||
|
||||
void Window::showFPS() {
|
||||
if (m_frameList.isEmpty()) {
|
||||
updateTitle();
|
||||
return;
|
||||
}
|
||||
qint64 total = 0;
|
||||
for (qint64 t : m_frameList) {
|
||||
total += t;
|
||||
}
|
||||
if (!total) {
|
||||
updateTitle();
|
||||
return;
|
||||
}
|
||||
double fps = (m_frameList.size() * 1e10) / total;
|
||||
m_frameList.clear();
|
||||
fps = round(fps) / 10.f;
|
||||
|
|
Loading…
Reference in New Issue