This function collects some time utilities. More...
#include <utilities.h>
Public Member Functions | |
TimeUtilities () | |
void | sleep (unsigned int t) |
It freezes the thread for t milliseconds. More... | |
void | get_start_time () |
It sets the start time for a measure. More... | |
void | get_end_time () |
It sets the end time for a measure. More... | |
int | get_num_measures () |
It returns the number of measures done. More... | |
double & | operator[] (const unsigned int num) |
An overload of the operator [] is provided to access to all measures. More... | |
Private Attributes | |
bool | status |
std::chrono::high_resolution_clock::time_point | t_start |
std::chrono::high_resolution_clock::time_point | t_end |
std::vector< double > | times |
This function collects some time utilities.
All measures are stored in seconds. Usage: get_start_time() should be used before get_end_time() and viceversa.
Definition at line 75 of file utilities.h.
|
inline |
Definition at line 79 of file utilities.h.
void TimeUtilities::get_end_time | ( | ) |
It sets the end time for a measure.
Definition at line 50 of file utilities.cc.
int TimeUtilities::get_num_measures | ( | ) |
It returns the number of measures done.
Definition at line 62 of file utilities.cc.
void TimeUtilities::get_start_time | ( | ) |
It sets the start time for a measure.
Definition at line 40 of file utilities.cc.
|
inline |
An overload of the operator [] is provided to access to all measures.
Definition at line 108 of file utilities.h.
void TimeUtilities::sleep | ( | unsigned int | t | ) |
It freezes the thread for t milliseconds.
Definition at line 35 of file utilities.cc.
|
private |
Definition at line 114 of file utilities.h.
|
private |
Definition at line 120 of file utilities.h.
|
private |
Definition at line 119 of file utilities.h.
|
private |
Definition at line 121 of file utilities.h.