summaryrefslogtreecommitdiff
path: root/src/support
diff options
context:
space:
mode:
authoryangwei <[email protected]>2023-08-06 08:34:46 +0800
committeryangwei <[email protected]>2023-08-06 18:11:03 +0800
commit8f2fb6cd223320e6acd925e68d541e3cfcca015e (patch)
tree75230bcf44eb806b87b78e5af85218add92e98af /src/support
parentbb36af1595a53ea74a19a18ac1b48856b8abd8d2 (diff)
✨ feat(clock_gettime): 使用CLOCK_MONOTONIC_COARSE
Diffstat (limited to 'src/support')
-rw-r--r--src/support/cpu_limit/cpu_limit.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/support/cpu_limit/cpu_limit.c b/src/support/cpu_limit/cpu_limit.c
index 8ffd13d..7b6fa9f 100644
--- a/src/support/cpu_limit/cpu_limit.c
+++ b/src/support/cpu_limit/cpu_limit.c
@@ -418,7 +418,7 @@ static inline long long _cl_get_current_time_in_ms(void)
//gettimeofday(&t, NULL);
//tms = t.tv_sec * 1000 + t.tv_usec/1000;
struct timespec t;
- clock_gettime(CLOCK_REALTIME, &t);
+ clock_gettime(CLOCK_MONOTONIC_COARSE, &t);
tms = (t.tv_sec)*1000 + (t.tv_nsec)/(1000*1000);
return tms;