|
| Timer (std::string componentName) |
|
void | start () |
| starts the timer or resumes it after a pause More...
|
|
void | pause () |
| pauses the timer More...
|
|
std::string | createFullyQualifiedSnapShotName (const std::string &snapshotName) |
| Creates a fully qualified name (how it is stored) More...
|
|
void | snapshot (std::string snapshotName) |
| saves current runtime as a snapshot. Useful for measuring the time of sub-components. More...
|
|
void | merge (Timer timer) |
| includes snapshots of another timer instance into this instance and adds overall runtime. More...
|
|
const std::vector< Snapshot > & | getSnapshots () const |
| returns the currently saved snapshots More...
|
|
int64_t | getRuntimeFromSnapshot (const std::string &snapShotName) |
| Returns the runtime of the snapshot with the snapShotName. More...
|
|
int64_t | getRuntime () const |
| returns the current runtime More...
|
|
const std::string & | getComponentName () const |
| returns the component name to measure More...
|
|
template<typename ConvertUnit = PrintTimeUnit, typename ConvertPrecision = PrintTimePrecision> |
ConvertPrecision | getPrintTime () const |
| return timer runtime converted ConvertUnit with ConvertPrecision e.g. for printing purposes. More...
|
|
template<typename TimeUnit = std::chrono::nanoseconds, typename PrintTimeUnit = std::milli, typename PrintTimePrecision = double, typename ClockType = std::chrono::high_resolution_clock>
class NES::Timer< TimeUnit, PrintTimeUnit, PrintTimePrecision, ClockType >
Util class to measure the time of NES components and sub-components using snapshots.
template<typename TimeUnit = std::chrono::nanoseconds, typename PrintTimeUnit = std::milli, typename PrintTimePrecision = double, typename ClockType = std::chrono::high_resolution_clock>
std::string NES::Timer< TimeUnit, PrintTimeUnit, PrintTimePrecision, ClockType >::createFullyQualifiedSnapShotName |
( |
const std::string & |
snapshotName | ) |
|
|
inline |
template<typename TimeUnit = std::chrono::nanoseconds, typename PrintTimeUnit = std::milli, typename PrintTimePrecision = double, typename ClockType = std::chrono::high_resolution_clock>
const std::string& NES::Timer< TimeUnit, PrintTimeUnit, PrintTimePrecision, ClockType >::getComponentName |
( |
| ) |
const |
|
inline |
template<typename TimeUnit = std::chrono::nanoseconds, typename PrintTimeUnit = std::milli, typename PrintTimePrecision = double, typename ClockType = std::chrono::high_resolution_clock>
template<typename ConvertUnit = PrintTimeUnit, typename ConvertPrecision = PrintTimePrecision>
ConvertPrecision NES::Timer< TimeUnit, PrintTimeUnit, PrintTimePrecision, ClockType >::getPrintTime |
( |
| ) |
const |
|
inline |
return timer runtime converted ConvertUnit with ConvertPrecision e.g. for printing purposes.
Referenced by NES::TEST().
template<typename TimeUnit = std::chrono::nanoseconds, typename PrintTimeUnit = std::milli, typename PrintTimePrecision = double, typename ClockType = std::chrono::high_resolution_clock>
int64_t NES::Timer< TimeUnit, PrintTimeUnit, PrintTimePrecision, ClockType >::getRuntimeFromSnapshot |
( |
const std::string & |
snapShotName | ) |
|
|
inline |
template<typename TimeUnit = std::chrono::nanoseconds, typename PrintTimeUnit = std::milli, typename PrintTimePrecision = double, typename ClockType = std::chrono::high_resolution_clock>
const std::vector<Snapshot>& NES::Timer< TimeUnit, PrintTimeUnit, PrintTimePrecision, ClockType >::getSnapshots |
( |
| ) |
const |
|
inline |
template<typename TimeUnit = std::chrono::nanoseconds, typename PrintTimeUnit = std::milli, typename PrintTimePrecision = double, typename ClockType = std::chrono::high_resolution_clock>
template<typename ConvertUnit = PrintTimeUnit>
static std::string NES::Timer< TimeUnit, PrintTimeUnit, PrintTimePrecision, ClockType >::getTimeUnitString |
( |
| ) |
|
|
inlinestatic |
template<typename TimeUnit = std::chrono::nanoseconds, typename PrintTimeUnit = std::milli, typename PrintTimePrecision = double, typename ClockType = std::chrono::high_resolution_clock>
void NES::Timer< TimeUnit, PrintTimeUnit, PrintTimePrecision, ClockType >::merge |
( |
Timer< TimeUnit, PrintTimeUnit, PrintTimePrecision, ClockType > |
timer | ) |
|
|
inline |
template<typename TimeUnit = std::chrono::nanoseconds, typename PrintTimeUnit = std::milli, typename PrintTimePrecision = double, typename ClockType = std::chrono::high_resolution_clock>
static std::string NES::Timer< TimeUnit, PrintTimeUnit, PrintTimePrecision, ClockType >::printHelper |
( |
std::string |
str, |
|
|
Snapshot |
s |
|
) |
| |
|
inlinestatic |
helper function for insert string operator recursively goes through the (probably) nested snapshots and prints them
References NES::Timer< TimeUnit, PrintTimeUnit, PrintTimePrecision, ClockType >::Snapshot::children, NES::Timer< TimeUnit, PrintTimeUnit, PrintTimePrecision, ClockType >::Snapshot::getPrintTime(), NES::Timer< TimeUnit, PrintTimeUnit, PrintTimePrecision, ClockType >::getTimeUnitString(), and NES::Timer< TimeUnit, PrintTimeUnit, PrintTimePrecision, ClockType >::Snapshot::name.
template<typename TimeUnit = std::chrono::nanoseconds, typename PrintTimeUnit = std::milli, typename PrintTimePrecision = double, typename ClockType = std::chrono::high_resolution_clock>
void NES::Timer< TimeUnit, PrintTimeUnit, PrintTimePrecision, ClockType >::snapshot |
( |
std::string |
snapshotName | ) |
|
|
inline |