src/oping.c: Fix calculation of fractional time.
authorFlorian Forster <ff@octo.it>
Mon, 27 Jun 2016 10:49:32 +0000 (12:49 +0200)
committerFlorian Forster <ff@octo.it>
Mon, 27 Jun 2016 10:49:32 +0000 (12:49 +0200)
It's "ns", not "us", stoopid!

src/oping.c

index 94515c2..e3bbffc 100644 (file)
@@ -1606,7 +1606,7 @@ static void update_host_hook (pingobj_iter_t *iter, /* {{{ */
 
                if (clock_gettime (CLOCK_REALTIME, &ts) == 0)
                {
-                       double t = ((double) ts.tv_sec) + (((double) ts.tv_nsec) / 1000000.0);
+                       double t = ((double) ts.tv_sec) + (((double) ts.tv_nsec) / 1000000000.0);
 
                        if ((sequence % 32) == 0)
                                fprintf (outfile, "#time,host,latency[ms]\n");