From 5df34ecfd881e23a85ce01280ee3998a5a4e4b7e Mon Sep 17 00:00:00 2001 From: "roberto@quantal64" Date: Sun, 26 Aug 2012 10:33:00 +0200 Subject: [PATCH] fixed nanoseconds/microseconds conversion --- plugins/clock_monotonic/clock_monotonic.c | 2 +- plugins/clock_realtime/clock_realtime.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/clock_monotonic/clock_monotonic.c b/plugins/clock_monotonic/clock_monotonic.c index e6d1c27f..a55fbb48 100644 --- a/plugins/clock_monotonic/clock_monotonic.c +++ b/plugins/clock_monotonic/clock_monotonic.c @@ -11,7 +11,7 @@ time_t uwsgi_monotonic_seconds() { uint64_t uwsgi_monotonic_microseconds() { struct timespec ts; clock_gettime(CLOCK_MONOTONIC, &ts); - return (ts.tv_sec * 1000000) + (ts.tv_nsec*1000); + return (ts.tv_sec * 1000000) + (ts.tv_nsec/1000); } diff --git a/plugins/clock_realtime/clock_realtime.c b/plugins/clock_realtime/clock_realtime.c index dd83ee40..043c5768 100644 --- a/plugins/clock_realtime/clock_realtime.c +++ b/plugins/clock_realtime/clock_realtime.c @@ -11,7 +11,7 @@ time_t uwsgi_realtime_seconds() { uint64_t uwsgi_realtime_microseconds() { struct timespec ts; clock_gettime(CLOCK_REALTIME, &ts); - return (ts.tv_sec * 1000000) + (ts.tv_nsec*1000); + return (ts.tv_sec * 1000000) + (ts.tv_nsec/1000); }