Skip to content

Commit

Permalink
changed monotonic clock to realtime
Browse files Browse the repository at this point in the history
  • Loading branch information
hfstco committed Jul 1, 2024
1 parent 533a6b6 commit 15570da
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions picoquic/quicctx.c
Original file line number Diff line number Diff line change
Expand Up @@ -4075,12 +4075,12 @@ uint64_t picoquic_current_time()
* Account for microseconds elapsed between 1601 and 1970.
*/
now -= 11644473600000000ULL;
#elif defined(CLOCK_MONOTONIC)
#elif defined(CLOCK_REALTIME)
/*
* Use CLOCK_MONOTONIC if exists (more accurate)
*/
struct timespec currentTime;
(void)clock_gettime(CLOCK_MONOTONIC, &currentTime);
(void)clock_gettime(CLOCK_REALTIME, &currentTime);
now = (currentTime.tv_sec * 1000000ull) + currentTime.tv_nsec / 1000ull;
#else
struct timeval tv;
Expand Down

0 comments on commit 15570da

Please sign in to comment.