PhoenixThread  1.0.0
Tools to ease parallel programming in C++
Loading...
Searching...
No Matches
phoenix_thread_clock.h File Reference
#include <chrono>
+ Include dependency graph for phoenix_thread_clock.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Typedefs

typedef int64_t PEllapsedTime
 
typedef std::chrono::steady_clock PhoenixClock
 
typedef std::chrono::time_point< std::chrono::steady_clock > PhoenixTime
 
typedef std::chrono::microseconds PMicroSecond
 
typedef std::chrono::nanoseconds PNanoSecond
 
typedef std::chrono::seconds PSecond
 

Functions

template<typename T>
PEllapsedTime phoenix_ellapsedTime (PhoenixTime referenceTime)
 Compute an ellapsed time in the given unit.
 
PhoenixTime phoenix_thread_clock ()
 Get the current time.
 

Typedef Documentation

◆ PEllapsedTime

typedef int64_t PEllapsedTime

Definition at line 18 of file phoenix_thread_clock.h.

◆ PhoenixClock

typedef std::chrono::steady_clock PhoenixClock

Definition at line 14 of file phoenix_thread_clock.h.

◆ PhoenixTime

typedef std::chrono::time_point<std::chrono::steady_clock> PhoenixTime

Definition at line 20 of file phoenix_thread_clock.h.

◆ PMicroSecond

typedef std::chrono::microseconds PMicroSecond

Definition at line 16 of file phoenix_thread_clock.h.

◆ PNanoSecond

typedef std::chrono::nanoseconds PNanoSecond

Definition at line 15 of file phoenix_thread_clock.h.

◆ PSecond

typedef std::chrono::seconds PSecond

Definition at line 17 of file phoenix_thread_clock.h.

Function Documentation

◆ phoenix_ellapsedTime()

template<typename T>
PEllapsedTime phoenix_ellapsedTime ( PhoenixTime referenceTime)

Compute an ellapsed time in the given unit.

Parameters
referenceTime: reference time (no unit, this is a time)
Returns
ellapsed time in the units specified by template (PNanoSecond, PMicroSecond, PSecond)

Definition at line 29 of file phoenix_thread_clock.h.

29 {
30 PNanoSecond ellapsedTime = phoenix_thread_clock() - referenceTime;
31 T ellapsedTimeUnit = (T)ellapsedTime;
32 return ellapsedTimeUnit.count();
33}
PhoenixTime phoenix_thread_clock()
Get the current time.
std::chrono::nanoseconds PNanoSecond

References phoenix_thread_clock().

Referenced by DetachPool::refresh(), and DetachPool::waitUntilAllFinish().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ phoenix_thread_clock()

PhoenixTime phoenix_thread_clock ( )

Get the current time.

Returns
current time in whatever unit

Definition at line 12 of file phoenix_thread_clock.cpp.

12 {
13 return PhoenixClock::now();
14}

Referenced by DetachPool::initialisationDetachPool(), phoenix_ellapsedTime(), DetachPool::refresh(), and DetachPool::waitUntilAllFinish().

+ Here is the caller graph for this function: