Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

[fuchsia] Add wrapper for zx_clock_get_monotonic. #23128

Merged
merged 1 commit into from
Dec 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions shell/platform/fuchsia/dart-pkg/zircon/lib/src/system.dart
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ class System extends NativeFieldWrapperClass2 {
static MapResult vmoMap(Handle vmo) native 'System_VmoMap';

// Time operations.
static int clockGetMonotonic() native 'System_ClockGetMonotonic';
static int clockGet(int clockId) native 'System_ClockGet';

// TODO(edcoyne): Remove this, it is required to safely do an API transition across repos.
Expand Down
4 changes: 4 additions & 0 deletions shell/platform/fuchsia/dart-pkg/zircon/sdk_ext/system.cc
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,10 @@ Dart_Handle System::VmoMap(fml::RefPtr<Handle> vmo) {
return ConstructDartObject(kMapResult, ToDart(ZX_OK), object);
}

uint64_t System::ClockGetMonotonic() {
return zx_clock_get_monotonic();
}

uint64_t System::ClockGet(uint32_t clock_id) {
zx_time_t result = 0;
zx_clock_get(clock_id, &result);
Expand Down
2 changes: 2 additions & 0 deletions shell/platform/fuchsia/dart-pkg/zircon/sdk_ext/system.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ class System : public fml::RefCountedThreadSafe<System>,

static Dart_Handle VmoMap(fml::RefPtr<Handle> vmo);

static uint64_t ClockGetMonotonic();

static uint64_t ClockGet(uint32_t clock_id);

static void RegisterNatives(tonic::DartLibraryNatives* natives);
Expand Down