diff options
author | Alex Merry <dev@randomguy3.me.uk> | 2012-04-22 23:50:03 +0100 |
---|---|---|
committer | Alex Merry <dev@randomguy3.me.uk> | 2012-04-22 23:50:03 +0100 |
commit | 03b1ed321059271a24b89ffcaf17fcfb14b6d1ff (patch) | |
tree | fe82adbf1618acbc94cb2bd0869a32c9c4d60945 | |
parent | a2b671eaa4827374dfe72695d196f687965278a4 (diff) |
Round time correctly
Otherwise we get "55969000ns (0:55)"
-rw-r--r-- | mpris2/playertestwidget.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/mpris2/playertestwidget.cpp b/mpris2/playertestwidget.cpp index c69347e..d45ae1f 100644 --- a/mpris2/playertestwidget.cpp +++ b/mpris2/playertestwidget.cpp @@ -20,7 +20,11 @@ #include "playertestwidget.h" #include "playerinterfacetest.h" + +#include <math.h> + #include <qdebug.h> + #include <QTimer> #include <QDBusObjectPath> @@ -100,7 +104,7 @@ void PlayerTestWidget::runIncrementalTest() static QString formatTimeNs(qlonglong time) { - qlonglong secs = time / 1000000; + qlonglong secs = static_cast<qlonglong>(round(time / 1000000.0)); qlonglong mins = secs / 60; secs = secs % 60; return QString::number(time) + "ns (" |