xrpld
Loading...
Searching...
No Matches
beast::BasicSecondsClock Class Reference

A clock whose minimum resolution is one second. More...

#include <basic_seconds_clock.h>

Public Types

using Clock = std::chrono::steady_clock
using rep = Clock::rep
using period = Clock::period
using duration = Clock::duration
using time_point = Clock::time_point

Public Member Functions

 BasicSecondsClock ()=default

Static Public Member Functions

static time_point now ()

Static Public Attributes

static bool const is_steady

Detailed Description

A clock whose minimum resolution is one second.

The purpose of this class is to optimize the performance of the now() member function call. It uses a dedicated thread that wakes up at least once per second to sample the requested trivial clock.

Template Parameters
ClockA type meeting these requirements: http://en.cppreference.com/w/cpp/concept/Clock

Definition at line 16 of file basic_seconds_clock.h.

Member Typedef Documentation

◆ Clock

◆ rep

using beast::BasicSecondsClock::rep = Clock::rep

Definition at line 23 of file basic_seconds_clock.h.

◆ period

using beast::BasicSecondsClock::period = Clock::period

Definition at line 24 of file basic_seconds_clock.h.

◆ duration

using beast::BasicSecondsClock::duration = Clock::duration

Definition at line 25 of file basic_seconds_clock.h.

◆ time_point

using beast::BasicSecondsClock::time_point = Clock::time_point

Definition at line 26 of file basic_seconds_clock.h.

Constructor & Destructor Documentation

◆ BasicSecondsClock()

beast::BasicSecondsClock::BasicSecondsClock ( )
explicitdefault

Member Function Documentation

◆ now()

BasicSecondsClock::time_point beast::BasicSecondsClock::now ( )
static

Definition at line 82 of file basic_seconds_clock.cpp.

Member Data Documentation

◆ is_steady

bool const beast::BasicSecondsClock::is_steady
static
Initial value:
=
Clock::is_steady

Definition at line 28 of file basic_seconds_clock.h.