From 0708303f4998df6388fc0e220227fee5213121c2 Mon Sep 17 00:00:00 2001 From: Kent Overstreet Date: Sun, 18 Jun 2023 14:31:59 -0400 Subject: [PATCH] Switch to CLOCK_MONOTONIC_COARSE CLOCK_MONOTONIC requires a syscall, and is much more expensive. Signed-off-by: Kent Overstreet --- include/linux/jiffies.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/jiffies.h b/include/linux/jiffies.h index 4fd3b68..d16ea76 100644 --- a/include/linux/jiffies.h +++ b/include/linux/jiffies.h @@ -71,7 +71,7 @@ static inline u64 sched_clock(void) { 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; } -- 2.39.5