Replace gettimeofday with clock_gettime (#2159)

This commit is contained in:
carpintero-de-c
2024-07-14 03:55:58 +05:30
committed by GitHub
parent 3f26818d97
commit 7c380a6612
8 changed files with 50 additions and 51 deletions

View File

@ -196,12 +196,11 @@ void afl_custom_splice_optout(void *data) {
inline u64 get_cur_time(void) {
struct timeval tv;
struct timezone tz;
struct timespec spec;
gettimeofday(&tv, &tz);
clock_gettime(CLOCK_REALTIME, &spec);
return (tv.tv_sec * 1000ULL) + (tv.tv_usec / 1000);
return (spec.tv_sec * 1000ULL) + (spec.tv_nsec / 1000000ULL);
}