summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWolf Bergenheim <ext-wolf.2.bergenheim@nokia.com>2010-10-20 15:13:40 +0300
committerWolf Bergenheim <ext-wolf.2.bergenheim@nokia.com>2010-10-20 15:24:59 +0300
commitcb0c1eac16226ca3cb8063bbbac8b3924a358ef7 (patch)
tree908f248e106abcfd467aa51014c9085ea917de3a
parent4c43f127b0fa603614ffd42b1952dfdca1cb9a21 (diff)
downloadlibresourceqt-cb0c1eac16226ca3cb8063bbbac8b3924a358ef7.tar.gz
fixed miss by 1000 in time calculations
-rw-r--r--resourceqt-client/resourceqt-client.pro2
-rw-r--r--resourceqt-client/time-stat.c4
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;
}
}