Flutter Engine
fml::TimePoint Class Reference

#include <time_point.h>

Public Member Functions

constexpr TimePoint ()=default
 
TimeDelta ToEpochDelta () const
 
TimeDelta operator- (TimePoint other) const
 
TimePoint operator+ (TimeDelta duration) const
 
TimePoint operator- (TimeDelta duration) const
 
bool operator== (TimePoint other) const
 
bool operator!= (TimePoint other) const
 
bool operator< (TimePoint other) const
 
bool operator<= (TimePoint other) const
 
bool operator> (TimePoint other) const
 
bool operator>= (TimePoint other) const
 

Static Public Member Functions

static TimePoint Now ()
 
static TimePoint CurrentWallTime ()
 
static constexpr TimePoint Min ()
 
static constexpr TimePoint Max ()
 
static constexpr TimePoint FromEpochDelta (TimeDelta ticks)
 
static constexpr TimePoint FromTicks (int64_t ticks)
 

Detailed Description

Definition at line 21 of file time_point.h.

Constructor & Destructor Documentation

◆ TimePoint()

constexpr fml::TimePoint::TimePoint ( )
default

Member Function Documentation

◆ CurrentWallTime()

TimePoint fml::TimePoint::CurrentWallTime ( )
static

Definition at line 43 of file time_point.cc.

References fml::NanosSinceEpoch(), and TimePoint().

Referenced by flutter::FrameTimingsRecorder::RecordRasterEnd(), and flutter::testing::TEST().

43  {
44  const int64_t nanos = NanosSinceEpoch(std::chrono::system_clock::now());
45  return TimePoint(nanos);
46 }
constexpr TimePoint()=default
static int64_t NanosSinceEpoch(std::chrono::time_point< Clock, Duration > time_point)
Definition: time_point.cc:33

◆ FromEpochDelta()

◆ FromTicks()

static constexpr TimePoint fml::TimePoint::FromTicks ( int64_t  ticks)
inlinestatic

Definition at line 43 of file time_point.h.

References TimePoint().

Referenced by fml::DartTimestampProvider::Now(), and fml::ChronoTimestampProvider::Now().

43  {
44  return TimePoint(ticks);
45  }
constexpr TimePoint()=default

◆ Max()

static constexpr TimePoint fml::TimePoint::Max ( )
inlinestatic

Definition at line 34 of file time_point.h.

References TimePoint().

Referenced by fml::MessageLoopTaskQueues::GetNextTaskToRun(), and fml::testing::TEST().

34  {
35  return TimePoint(std::numeric_limits<int64_t>::max());
36  }
constexpr TimePoint()=default

◆ Min()

static constexpr TimePoint fml::TimePoint::Min ( )
inlinestatic

Definition at line 30 of file time_point.h.

References TimePoint().

Referenced by flutter_runner::GfxSessionConnection::AwaitVsyncForSecondaryCallback().

30  {
31  return TimePoint(std::numeric_limits<int64_t>::min());
32  }
constexpr TimePoint()=default

◆ Now()

TimePoint fml::TimePoint::Now ( )
static

Definition at line 39 of file time_point.cc.

References fml::DartTimelineTicksSinceEpoch().

Referenced by VSyncClient::await, flutter::testing::ShellTestVsyncWaiter::AwaitVSync(), flutter_runner::FlatlandConnection::AwaitVsync(), flutter_runner::FlatlandConnection::AwaitVsyncForSecondaryCallback(), fml::benchmarking::BM_RegisterAndGetTasks(), flutter::testing::PendingTests::CheckTimedOutTests(), flutter::CreateFinishedBuildRecorder(), flutter::Stopwatch::CurrentLap(), fml::MessageLoopImpl::DoTerminate(), flutter::Rasterizer::Draw(), flutter::Rasterizer::DrawLastLayerTree(), flutter::PersistentCache::DumpSkp(), flutter::VsyncWaiter::FireCallback(), FlutterEngineGetCurrentTime(), flutter::FxlToDartOrEarlier(), flutter::EmbedderTaskRunner::GetEmbedderIdentifier(), flutter::testing::GetTestNameFromTestInfo(), flutter::DartIsolate::LoadLoadingUnitError(), flutter::Shell::OnDisplayUpdates(), fml::TaskRunner::PostDelayedTask(), fml::TaskRunner::PostTask(), flutter::FrameTimingsRecorder::RecordRasterEnd(), flutter::Animator::Render(), flutter::Stopwatch::Start(), flutter::Stopwatch::Stop(), TEST(), flutter::testing::TEST(), fml::testing::TEST(), flutter_runner::testing::TEST(), flutter_runner::testing::TEST_F(), flutter::testing::TEST_F(), flutter::VsyncWaiterAndroid::VsyncWaiterAndroid(), flutter::VsyncWaiterFallback::VsyncWaiterFallback(), fml::AutoResetWaitableEvent::WaitWithTimeout(), and fml::WaitWithTimeoutImpl().

39  {
41 }
fml::TimePoint DartTimelineTicksSinceEpoch()

◆ operator!=()

bool fml::TimePoint::operator!= ( TimePoint  other) const
inline

Definition at line 62 of file time_point.h.

62 { return ticks_ != other.ticks_; }

◆ operator+()

TimePoint fml::TimePoint::operator+ ( TimeDelta  duration) const
inline

Definition at line 54 of file time_point.h.

References TimePoint(), and fml::TimeDelta::ToNanoseconds().

54  {
55  return TimePoint(ticks_ + duration.ToNanoseconds());
56  }
constexpr TimePoint()=default

◆ operator-() [1/2]

TimeDelta fml::TimePoint::operator- ( TimePoint  other) const
inline

Definition at line 50 of file time_point.h.

References fml::TimeDelta::FromNanoseconds().

50  {
51  return TimeDelta::FromNanoseconds(ticks_ - other.ticks_);
52  }
static constexpr TimeDelta FromNanoseconds(int64_t nanos)
Definition: time_delta.h:40

◆ operator-() [2/2]

TimePoint fml::TimePoint::operator- ( TimeDelta  duration) const
inline

Definition at line 57 of file time_point.h.

References TimePoint(), and fml::TimeDelta::ToNanoseconds().

57  {
58  return TimePoint(ticks_ - duration.ToNanoseconds());
59  }
constexpr TimePoint()=default

◆ operator<()

bool fml::TimePoint::operator< ( TimePoint  other) const
inline

Definition at line 63 of file time_point.h.

63 { return ticks_ < other.ticks_; }

◆ operator<=()

bool fml::TimePoint::operator<= ( TimePoint  other) const
inline

Definition at line 64 of file time_point.h.

64 { return ticks_ <= other.ticks_; }

◆ operator==()

bool fml::TimePoint::operator== ( TimePoint  other) const
inline

Definition at line 61 of file time_point.h.

61 { return ticks_ == other.ticks_; }

◆ operator>()

bool fml::TimePoint::operator> ( TimePoint  other) const
inline

Definition at line 65 of file time_point.h.

65 { return ticks_ > other.ticks_; }

◆ operator>=()

bool fml::TimePoint::operator>= ( TimePoint  other) const
inline

Definition at line 66 of file time_point.h.

References TimePoint().

66 { return ticks_ >= other.ticks_; }

◆ ToEpochDelta()


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