Skip to content

Commit b367a34

Browse files
committed
Fix steady clock implementation
1 parent a23499b commit b367a34

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libcxx/src/chrono.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ static steady_clock::time_point __libcpp_steady_clock_now() {
235235
struct timespec ts;
236236
if (timespec_get(&ts, TIME_MONOTONIC) != TIME_MONOTONIC)
237237
__throw_system_error(errno, "timespec_get(TIME_MONOTONIC) failed");
238-
return steady_clock::time_point(seconds(tp.tv_sec) + nanoseconds(tp.tv_nsec));
238+
return steady_clock::time_point(seconds(ts.tv_sec) + microseconds(ts.tv_nsec / 1000));
239239
}
240240

241241
# elif defined(_LIBCPP_HAS_CLOCK_GETTIME)

0 commit comments

Comments
 (0)