Switch to CLOCK_MONOTONIC_COARSE

CLOCK_MONOTONIC requires a syscall, and is much more expensive.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
Kent Overstreet 2023-06-18 14:31:59 -04:00
parent f9a366f9a6
commit 0708303f49

View File

@ -71,7 +71,7 @@ static inline u64 sched_clock(void)
{ {
struct timespec ts; struct timespec ts;
clock_gettime(CLOCK_MONOTONIC, &ts); clock_gettime(CLOCK_MONOTONIC_COARSE, &ts);
return ((s64) ts.tv_sec * NSEC_PER_SEC) + ts.tv_nsec; return ((s64) ts.tv_sec * NSEC_PER_SEC) + ts.tv_nsec;
} }