소스 검색

LibC: Use CLOCK_REALTIME_COARSE for gettimeofday()

This doesn't need to use our highest-precision timestamp.
Andreas Kling 3 년 전
부모
커밋
afa225f55c
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      Userland/Libraries/LibC/time.cpp

+ 1 - 1
Userland/Libraries/LibC/time.cpp

@@ -45,7 +45,7 @@ int gettimeofday(struct timeval* __restrict__ tv, void* __restrict__)
     }
     }
 
 
     struct timespec ts = {};
     struct timespec ts = {};
-    if (clock_gettime(CLOCK_REALTIME, &ts) < 0)
+    if (clock_gettime(CLOCK_REALTIME_COARSE, &ts) < 0)
         return -1;
         return -1;
 
 
     TIMESPEC_TO_TIMEVAL(tv, &ts);
     TIMESPEC_TO_TIMEVAL(tv, &ts);