summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRonny Chevalier <chevalier.ronny@gmail.com>2014-08-18 20:59:11 +0200
committerLennart Poettering <lennart@poettering.net>2014-08-18 21:02:04 +0200
commitece74070c7102b2d48ccc01260976b3f5cb6d9f0 (patch)
treeb3e571f7b32158a009bee9a4ad6d96ff37c34ca2 /src
parentfe3f22d116f6f0cac3bdfa512ac54c0faf8bb7cd (diff)
bootchart: use NSEC_PER_SEC
Diffstat (limited to 'src')
-rw-r--r--src/bootchart/store.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/bootchart/store.c b/src/bootchart/store.c
index cedcba88ed..2d2ea428fa 100644
--- a/src/bootchart/store.c
+++ b/src/bootchart/store.c
@@ -34,6 +34,7 @@
#include <time.h>
#include "util.h"
+#include "time-util.h"
#include "strxcpyx.h"
#include "store.h"
#include "bootchart.h"
@@ -54,14 +55,14 @@ double gettime_ns(void) {
clock_gettime(CLOCK_MONOTONIC, &n);
- return (n.tv_sec + (n.tv_nsec / 1000000000.0));
+ return (n.tv_sec + (n.tv_nsec / (double) NSEC_PER_SEC));
}
static double gettime_up(void) {
struct timespec n;
clock_gettime(CLOCK_BOOTTIME, &n);
- return (n.tv_sec + (n.tv_nsec / 1000000000.0));
+ return (n.tv_sec + (n.tv_nsec / (double) NSEC_PER_SEC));
}
void log_uptime(void) {