X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=src%2Foping.c;h=8c35f3b0c0182d444606261149ee7a660f8e170c;hb=0e90282ea8abe28840316e26483c39c33841ee96;hp=0cfe64672065c0a99dd3a1d2e9ca8bc9bd5763ce;hpb=0e8b1b239fdcf9307a14d57c1620843e86932583;p=liboping.git diff --git a/src/oping.c b/src/oping.c index 0cfe646..8c35f3b 100644 --- a/src/oping.c +++ b/src/oping.c @@ -1614,11 +1614,10 @@ static void update_host_hook (pingobj_iter_t *iter, /* {{{ */ if (outfile != NULL) { - struct timespec ts = { 0, 0 }; - - if (clock_gettime (CLOCK_REALTIME, &ts) == 0) + struct timeval tv = {0}; + if (gettimeofday (&tv, NULL) == 0) { - double t = ((double) ts.tv_sec) + (((double) ts.tv_nsec) / 1000000000.0); + double t = ((double) tv.tv_sec) + (((double) tv.tv_usec) / 1000000.0); if ((sequence % 32) == 0) fprintf (outfile, "#time,host,latency[ms]\n");