PhoenixClock  2.2.0
Library wrapping the usage of system's clock, allowing to use clock mock-ups
Loading...
Searching...
No Matches
PClockBackend Struct Reference

clock backend for clock More...

#include <PClockBackend.h>

Static Public Member Functions

static time_t now ()
 Get current time with PClockBackend.
 
static void sleep (EllapsedTime ellapsedTime)
 Sleep for the given ellapsed time.
 

Detailed Description

clock backend for clock

Definition at line 15 of file PClockBackend.h.

Member Function Documentation

◆ now()

static time_t PClockBackend::now ( )
inlinestatic

Get current time with PClockBackend.

Returns
current time given by clock

Definition at line 19 of file PClockBackend.h.

19 {
20 return clock();
21 }

◆ sleep()

static void PClockBackend::sleep ( EllapsedTime ellapsedTime)
inlinestatic

Sleep for the given ellapsed time.

Parameters
ellapsedTime: time to sleep

Definition at line 26 of file PClockBackend.h.

26 {
27 std::this_thread::sleep_for(std::chrono::nanoseconds(ellapsedTime));
28 }

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