MarlinMT
0.1.0
|
clock class Provide a wrapper around a certain clock type in std to perform safe clock measurement in multi-threading environement More...
#include <Utils.h>
Public Types | |
using | clock_type = std::chrono::steady_clock |
using | time_point = clock_type::time_point |
using | duration_rep = float |
using | pair = std::pair< duration_rep, duration_rep > |
using | nanoseconds = std::chrono::duration< duration_rep, std::nano > |
using | microseconds = std::chrono::duration< duration_rep, std::micro > |
using | milliseconds = std::chrono::duration< duration_rep, std::milli > |
using | seconds = std::chrono::duration< duration_rep > |
using | minutes = std::chrono::duration< duration_rep, std::ratio< 60 > > |
Public Member Functions | |
clock ()=delete | |
~clock ()=delete | |
Static Public Member Functions | |
static time_point | now () |
Get the current time. More... | |
template<class unit = seconds> | |
static duration_rep | elapsed_since (const time_point &since) |
Get the elapsed time since a previous time point. More... | |
template<class unit = seconds> | |
static duration_rep | time_difference (const time_point &older, const time_point &ealier) |
Get the time difference between two time points. More... | |
template<class unit = seconds> | |
static void | crunchFor (duration_rep crunchTime) |
Crunch numbers for some time. More... | |
clock class Provide a wrapper around a certain clock type in std to perform safe clock measurement in multi-threading environement
using marlinmt::clock::clock_type = std::chrono::steady_clock |
using marlinmt::clock::duration_rep = float |
using marlinmt::clock::microseconds = std::chrono::duration<duration_rep, std::micro> |
using marlinmt::clock::milliseconds = std::chrono::duration<duration_rep, std::milli> |
using marlinmt::clock::minutes = std::chrono::duration<duration_rep, std::ratio<60> > |
using marlinmt::clock::nanoseconds = std::chrono::duration<duration_rep, std::nano> |
using marlinmt::clock::pair = std::pair<duration_rep, duration_rep> |
using marlinmt::clock::seconds = std::chrono::duration<duration_rep> |
using marlinmt::clock::time_point = clock_type::time_point |
|
delete |
|
delete |
|
inlinestatic |
|
inlinestatic |
Get the elapsed time since a previous time point.
The template parameter 'unit' allows for casting the result to a specific unit (default seconds). Use the duration types defined in this class to get a correct calculation. The result is floating type.
since | an earlier time point |
Definition at line 64 of file Utils.h.
References now().
|
inlinestatic |
Get the current time.
Definition at line 50 of file Utils.h.
Referenced by crunchFor(), elapsed_since(), marlinmt::concurrency::PEPScheduler::end(), marlinmt::concurrency::PEPScheduler::initialize(), marlinmt::concurrency::PEPScheduler::popFinishedEvents(), marlinmt::SequenceItem::processEvent(), marlinmt::concurrency::PEPScheduler::processRunHeader(), and marlinmt::concurrency::PEPScheduler::pushEvent().
|
inlinestatic |
Get the time difference between two time points.
The template parameter 'unit' allows for casting the result to a specific unit (default seconds). Use the duration types defined in this class to get a correct calculation. The result is floating type. Example:
older | the oldest time point |
ealier | the earliest time point |
Definition at line 88 of file Utils.h.
Referenced by marlinmt::concurrency::PEPScheduler::end().