Flutter Engine
The Flutter Engine
Public Member Functions | Static Public Member Functions | List of all members
fml::ChronoTimestampProvider Class Reference

#include <chrono_timestamp_provider.h>

Inheritance diagram for fml::ChronoTimestampProvider:
fml::TimestampProvider

Public Member Functions

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

Static Public Member Functions

static ChronoTimestampProviderInstance ()
 

Detailed Description

TimestampProvider implementation that is backed by std::chrono::steady_clock meant to be used only in tests for fml. Other components needing the current time ticks since epoch should instantiate their own time stamp provider backed by Dart clock.

Definition at line 19 of file chrono_timestamp_provider.h.

Constructor & Destructor Documentation

◆ ~ChronoTimestampProvider()

fml::ChronoTimestampProvider::~ChronoTimestampProvider ( )
overridedefault

Member Function Documentation

◆ Instance()

static ChronoTimestampProvider & fml::ChronoTimestampProvider::Instance ( )
inlinestatic

Definition at line 21 of file chrono_timestamp_provider.h.

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

◆ Now()

fml::TimePoint fml::ChronoTimestampProvider::Now ( )
overridevirtual

Implements fml::TimestampProvider.

Definition at line 15 of file chrono_timestamp_provider.cc.

15 {
16 const auto chrono_time_point = std::chrono::steady_clock::now();
17 const auto ticks_since_epoch = chrono_time_point.time_since_epoch().count();
18 return fml::TimePoint::FromTicks(ticks_since_epoch);
19}
static constexpr TimePoint FromTicks(int64_t ticks)
Definition: time_point.h:48

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