lcls2
C++ API: public headers of xtcdata, psalg, psdaq and psana
Loading...
Searching...
No Matches
Pds::fast_monotonic_clock Class Reference

std::chrono-style steady clock with nanosecond duration read with clock_gettime(): CLOCK_MONOTONIC_COARSE if it works on this system, otherwise CLOCK_MONOTONIC (chosen once on first use). More...

#include <fast_monotonic_clock.hh>

Public Types

using duration = std::chrono::nanoseconds
 Duration type: std::chrono::nanoseconds.
 
using rep = duration::rep
 Tick count type of duration.
 
using period = duration::period
 Tick period of duration (nanoseconds).
 
using time_point = std::chrono::time_point< fast_monotonic_clock >
 Time point of this clock.
 

Static Public Member Functions

static time_point now (clockid_t clkId=clock_id()) noexcept
 Return the current time of clock clkId (the selected default clock unless given), via clock_gettime(); the result is only checked by assert().
 
static duration get_resolution (clockid_t clkId=clock_id()) noexcept
 Return the resolution of clock clkId (the selected default clock unless given), via clock_getres().
 

Static Public Attributes

static constexpr bool is_steady = true
 True: the clock is monotonic.
 

Detailed Description

std::chrono-style steady clock with nanosecond duration read with clock_gettime(): CLOCK_MONOTONIC_COARSE if it works on this system, otherwise CLOCK_MONOTONIC (chosen once on first use).

Member Typedef Documentation

◆ duration

using Pds::fast_monotonic_clock::duration = std::chrono::nanoseconds

Duration type: std::chrono::nanoseconds.

◆ period

using Pds::fast_monotonic_clock::period = duration::period

Tick period of duration (nanoseconds).

◆ rep

using Pds::fast_monotonic_clock::rep = duration::rep

Tick count type of duration.

◆ time_point

Time point of this clock.

Member Function Documentation

◆ get_resolution()

auto Pds::fast_monotonic_clock::get_resolution ( clockid_t  clkId = clock_id())
inlinestaticnoexcept

Return the resolution of clock clkId (the selected default clock unless given), via clock_getres().

◆ now()

auto Pds::fast_monotonic_clock::now ( clockid_t  clkId = clock_id())
inlinestaticnoexcept

Return the current time of clock clkId (the selected default clock unless given), via clock_gettime(); the result is only checked by assert().

Member Data Documentation

◆ is_steady

constexpr bool Pds::fast_monotonic_clock::is_steady = true
staticconstexpr

True: the clock is monotonic.


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