4 ms·
gettimeofday is obsolescent, but its replacement clock_gettime has the same issue. gettimeofday gives you a struct timeval with microsecond resolution. clock_
by _kst_ 7y ago
gettimeofday is obsolescent, but its replacement clock_gettime has the same issue.
gettimeofday gives you a struct timeval with microsecond resolution.
clock_gettime (which takes an extra argument specifying which of several clocks to use) gives you a struct timespec, with nanosecond resolution.
https://pubs.opengroup.org/onlinepubs/9699919799/functions/clock_gettime.html https://pubs.opengroup.org/onlinepubs/9699919799/functions/c...