chiark / gitweb /
bootchart: use NSEC_PER_SEC
authorRonny Chevalier <chevalier.ronny@gmail.com>
Mon, 18 Aug 2014 18:59:11 +0000 (20:59 +0200)
committerLennart Poettering <lennart@poettering.net>
Mon, 18 Aug 2014 19:02:04 +0000 (21:02 +0200)
src/bootchart/store.c

index cedcba88ed1b8059c03281c75cd2a8fc1c52f992..2d2ea428fa570804e1c467727c2a6abd4657fe9c 100644 (file)
@@ -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) {