PhoenixThread  1.0.0
Tools to ease parallel programming in C++
Loading...
Searching...
No Matches
phoenix_thread_clock.h
Go to the documentation of this file.
1/***************************************
2 Auteur : Pierre Aubert
3 Mail : pierre.aubert@lapp.in2p3.fr
4 Licence : CeCILL-C
5****************************************/
6
7
8
9#ifndef __PHOENIX_THREAD_CLOCK_H__
10#define __PHOENIX_THREAD_CLOCK_H__
11
12#include <chrono>
13
14typedef std::chrono::steady_clock PhoenixClock;
15typedef std::chrono::nanoseconds PNanoSecond;
16typedef std::chrono::microseconds PMicroSecond;
17typedef std::chrono::seconds PSecond;
18typedef int64_t PEllapsedTime;
19
20typedef std::chrono::time_point<std::chrono::steady_clock> PhoenixTime;
21
23
25
28template<typename T>
30 PNanoSecond ellapsedTime = phoenix_thread_clock() - referenceTime;
31 T ellapsedTimeUnit = (T)ellapsedTime;
32 return ellapsedTimeUnit.count();
33}
34
35#endif
PhoenixTime phoenix_thread_clock()
Get the current time.
std::chrono::time_point< std::chrono::steady_clock > PhoenixTime
std::chrono::nanoseconds PNanoSecond
std::chrono::seconds PSecond
PEllapsedTime phoenix_ellapsedTime(PhoenixTime referenceTime)
Compute an ellapsed time in the given unit.
int64_t PEllapsedTime
std::chrono::microseconds PMicroSecond
std::chrono::steady_clock PhoenixClock