STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Types | Static Public Member Functions | Static Public Attributes | List of all members
chrono::steady_clock Struct Reference

Public Types

typedef long long rep
 
typedef nano period
 
typedef nanoseconds duration
 
typedef chrono::time_point< steady_clocktime_point
 

Static Public Member Functions

static time_point now () _NOEXCEPT
 

Static Public Attributes

static constexpr bool is_steady = true
 

Member Typedef Documentation

Member Function Documentation

static time_point chrono::steady_clock::now ( )
inlinestatic
1002  { // get current time
1003  const long long _Freq = _Query_perf_frequency(); // doesn't change after system boot
1004  const long long _Ctr = _Query_perf_counter();
1005  static_assert(period::num == 1, "This assumes period::num == 1.");
1006  const long long _Whole = (_Ctr / _Freq) * period::den;
1007  const long long _Part = (_Ctr % _Freq) * period::den / _Freq;
1008  return (time_point(duration(_Whole + _Part)));
1009  }
chrono::time_point< steady_clock > time_point
Definition: chrono:998
_CRTIMP2_PURE long long __cdecl _Query_perf_frequency(void)
_CRTIMP2_PURE long long __cdecl _Query_perf_counter(void)
static constexpr intmax_t den
Definition: ratio:120
nanoseconds duration
Definition: chrono:997
static constexpr intmax_t num
Definition: ratio:117

Member Data Documentation

constexpr bool chrono::steady_clock::is_steady = true
static

The documentation for this struct was generated from the following file: