Flutter Engine
The Flutter Engine
Functions
SkTime Namespace Reference

Functions

double GetNSecs ()
 
double GetSecs ()
 
double GetMSecs ()
 

Detailed Description

Platform-implemented utilities to return a monotonic counter.

Function Documentation

◆ GetMSecs()

double SkTime::GetMSecs ( )
inline

Definition at line 17 of file SkTime.h.

17{ return GetNSecs() * 1e-6; }
double GetNSecs()
Definition: SkTime.cpp:17

◆ GetNSecs()

double SkTime::GetNSecs ( )

Definition at line 17 of file SkTime.cpp.

17 {
18#if __has_feature(memory_sanitizer)
19 // See skia:6504
20 struct timespec tp;
21 clock_gettime(CLOCK_MONOTONIC, &tp);
22 return tp.tv_sec * 1e9 + tp.tv_nsec;
23#else
24 auto now = std::chrono::steady_clock::now();
25 std::chrono::duration<double, std::nano> ns = now.time_since_epoch();
26 return ns.count();
27#endif
28}

◆ GetSecs()

double SkTime::GetSecs ( )
inline

Definition at line 16 of file SkTime.h.

16{ return GetNSecs() * 1e-9; }