Skip to content

Commit 4fa4df9

Browse files
committed
[compiler-rt] Migrate to _zx_clock_get_new/_zx_clock_get_monotonic
This is part of the soft-transition to the new _zx_clock_get signature. Differential Revision: https://reviews.llvm.org/D61768 llvm-svn: 360394
1 parent bd588df commit 4fa4df9

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

compiler-rt/lib/sanitizer_common/sanitizer_fuchsia.cc

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,14 @@ unsigned int internal_sleep(unsigned int seconds) {
4646
return 0;
4747
}
4848

49-
u64 NanoTime() { return _zx_clock_get(ZX_CLOCK_UTC); }
49+
u64 NanoTime() {
50+
zx_time_t time;
51+
zx_status_t status = _zx_clock_get_new(ZX_CLOCK_UTC, &time);
52+
CHECK_EQ(status, ZX_OK);
53+
return time;
54+
}
5055

51-
u64 MonotonicNanoTime() { return _zx_clock_get(ZX_CLOCK_MONOTONIC); }
56+
u64 MonotonicNanoTime() { return _zx_clock_get_monotonic(); }
5257

5358
uptr internal_getpid() {
5459
zx_info_handle_basic_t info;

0 commit comments

Comments
 (0)