We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2cde843 commit c0f3fe4Copy full SHA for c0f3fe4
1 file changed
wolfcrypt/benchmark/benchmark.c
@@ -12489,16 +12489,16 @@ void bench_sphincsKeySign(byte level, byte optim)
12489
12490
double current_time(int reset)
12491
{
12492
- struct timeval tv;
+ struct timespec tv;
12493
12494
(void)reset;
12495
12496
- LIBCALL_CHECK_RET(gettimeofday(&tv, 0));
+ LIBCALL_CHECK_RET(clock_gettime(CLOCK_REALTIME, &tv));
12497
12498
#ifdef BENCH_MICROSECOND
12499
- return (double)tv.tv_sec * 1000000 + (double)tv.tv_usec;
+ return (double)tv.tv_sec * 1000000 + (double)tv.tv_nsec / 1000;
12500
#else
12501
- return (double)tv.tv_sec + (double)tv.tv_usec / 1000000;
+ return (double)tv.tv_sec + (double)tv.tv_nsec / 1000000000;
12502
#endif
12503
}
12504
0 commit comments