From: Kent Overstreet Date: Sun, 18 Jun 2023 18:31:59 +0000 (-0400) Subject: Switch to CLOCK_MONOTONIC_COARSE X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=0708303f4998df6388fc0e220227fee5213121c2;p=bcachefs-tools-debian Switch to CLOCK_MONOTONIC_COARSE CLOCK_MONOTONIC requires a syscall, and is much more expensive. Signed-off-by: Kent Overstreet --- 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; }