Flutter Engine
The Flutter Engine
Public Member Functions | Static Public Member Functions | List of all members
flutter::DartTimestampProvider Class Reference

TimestampProvider implementation that is backed by Dart_TimelineGetTicks. More...

#include <dart_timestamp_provider.h>

Inheritance diagram for flutter::DartTimestampProvider:
fml::TimestampProvider

Public Member Functions

 ~DartTimestampProvider () override
 
fml::TimePoint Now () override
 

Static Public Member Functions

static DartTimestampProviderInstance ()
 

Detailed Description

TimestampProvider implementation that is backed by Dart_TimelineGetTicks.

Definition at line 18 of file dart_timestamp_provider.h.

Constructor & Destructor Documentation

◆ ~DartTimestampProvider()

flutter::DartTimestampProvider::~DartTimestampProvider ( )
overridedefault

Member Function Documentation

◆ Instance()

static DartTimestampProvider & flutter::DartTimestampProvider::Instance ( )
inlinestatic

Definition at line 20 of file dart_timestamp_provider.h.

20 {
21 static DartTimestampProvider instance;
22 return instance;
23 }
VkInstance instance
Definition: main.cc:48

◆ Now()

fml::TimePoint flutter::DartTimestampProvider::Now ( )
overridevirtual

Implements fml::TimestampProvider.

Definition at line 23 of file dart_timestamp_provider.cc.

23 {
24 const int64_t ticks = Dart_TimelineGetTicks();
25 const int64_t frequency = Dart_TimelineGetTicksFrequency();
26 // optimization for the most common case.
27 if (frequency != kNanosPerSecond) {
28 return fml::TimePoint::FromTicks(ConvertToNanos(ticks, frequency));
29 } else {
30 return fml::TimePoint::FromTicks(ticks);
31 }
32}
static constexpr TimePoint FromTicks(int64_t ticks)
Definition: time_point.h:48
DART_EXPORT int64_t Dart_TimelineGetTicksFrequency()
DART_EXPORT int64_t Dart_TimelineGetTicks()

The documentation for this class was generated from the following files: