mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
[fuchsia] Add wrapper for zx_clock_get_monotonic. (#23128)
Bug: https://github.com/flutter/flutter/issues/72321 Co-authored-by: Jody Sankey <jsankey@google.com>
This commit is contained in:
parent
76310c4264
commit
6e54f0d2df
@ -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.
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user