diff options
-rw-r--r-- | resourceqt-client/resourceqt-client.pro | 2 | ||||
-rw-r--r-- | resourceqt-client/time-stat.c | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/resourceqt-client/resourceqt-client.pro b/resourceqt-client/resourceqt-client.pro index 50507fa..99a69b1 100644 --- a/resourceqt-client/resourceqt-client.pro +++ b/resourceqt-client/resourceqt-client.pro @@ -33,7 +33,7 @@ CONFIG -= app_bundle INCLUDEPATH += $${LIBRESOURCEINC} QMAKE_CXXFLAGS += -Wall QMAKE_CFLAGS += -std=c99 -D_POSIX_C_SOURCE=199309L -LIBS += -L$${LIBRESOURCEQT}/build -lresourceqt -L$${LIBDBUSQEVENTLOOP}/build -ldbus-qeventloop -lm -lrt +LIBS += -L$${LIBRESOURCEQT}/build -lresourceqt -L$${LIBDBUSQEVENTLOOP}/build -ldbus-qeventloop -lrt # Input HEADERS = client.h commandlineparser.h time-stat.h diff --git a/resourceqt-client/time-stat.c b/resourceqt-client/time-stat.c index f28ae02..efa35a2 100644 --- a/resourceqt-client/time-stat.c +++ b/resourceqt-client/time-stat.c @@ -51,8 +51,8 @@ long int stop_timer(void) temp.tv_nsec = end_time.tv_nsec - start_time.tv_nsec; } - milliseconds = 1000 * temp.tv_sec + temp.tv_nsec / 1000; - if (temp.tv_nsec % 1000 > 500) { + milliseconds = (1000 * temp.tv_sec) + (temp.tv_nsec / 1000000); + if (temp.tv_nsec % 1000000 > 500000) { ++milliseconds; } } |