utility class to measure time duration in AthenaMT The pattern when it is useful: AlgA tags the beginning of the time period AlgA::execute() { timeStampHandle.record( std::move( std::make_unique<TrigTimeStamp>() ) ); }
More...
#include <TrigTimeStamp.h>
|
| typedef std::chrono::high_resolution_clock::time_point | stamp_type |
utility class to measure time duration in AthenaMT The pattern when it is useful: AlgA tags the beginning of the time period AlgA::execute() { timeStampHandle.record( std::move( std::make_unique<TrigTimeStamp>() ) ); }
AlgB obtains the duration since the start tagged in AlgA: AlgB::execute() { double duration = timeStampHandle.cptr().millisecondsSince(); }
Definition at line 23 of file TrigTimeStamp.h.
◆ stamp_type
◆ TrigTimeStamp() [1/2]
| TrigTimeStamp::TrigTimeStamp |
( |
| ) |
|
|
inline |
Default constructor, sets to now.
Definition at line 76 of file TrigTimeStamp.h.
void set(stamp_type time=std::chrono::high_resolution_clock::now())
Update the stamp value.
◆ TrigTimeStamp() [2/2]
Automatic copy constructor.
◆ get()
◆ microsecondsSinceEpoch()
| uint64_t TrigTimeStamp::microsecondsSinceEpoch |
( |
| ) |
const |
- Returns
- The time duration between when the time stamp was created and the epoch
Definition at line 15 of file TrigTimeStamp.cxx.
15 {
16
19}
uint64_t microsecondsSinceEpoch() const
◆ millisecondsDifference()
| double TrigTimeStamp::millisecondsDifference |
( |
const TrigTimeStamp & | other | ) |
const |
- Returns
- The time duration between when this and another time stamp were created, or last set
- Parameters
-
| [in] | other | Time stamp to compare this one to |
Definition at line 11 of file TrigTimeStamp.cxx.
11 {
12 return std::chrono::duration_cast<std::chrono::milliseconds>(
other.get() -
m_stamp ).count();
13}
◆ millisecondsSince()
| double TrigTimeStamp::millisecondsSince |
( |
| ) |
const |
- Returns
- The time duration between now and when the time stamp was created
Definition at line 7 of file TrigTimeStamp.cxx.
7 {
8 return std::chrono::duration_cast<std::chrono::milliseconds>( std::chrono::high_resolution_clock::now() -
m_stamp ).count();
9}
◆ operator=()
Automatic copy assignemnt operator.
◆ set()
Update the stamp value.
- Parameters
-
| [in] | time | Time to set. Default is now. |
Definition at line 80 of file TrigTimeStamp.h.
time(flags, cells_name, *args, **kw)
◆ m_stamp
The documentation for this class was generated from the following files: