Mantid
|
CPUTimer : Timer that uses the CPU time, rather than wall-clock time to measure execution time. More...
#include <CPUTimer.h>
Public Member Functions | |
float | CPUfraction (bool doReset=true) |
Return the fraction of the CPU used (CPUTime/wall-clock time). More... | |
CPUTimer () | |
Constructor. More... | |
float | elapsedCPU (bool doReset=true) |
Calculate the elapsed CPU time, reseting the timer if specified. More... | |
float | elapsedWallClock (bool doReset=true) |
Calculate the elapsed wall-clock time, reseting the timer if specified. More... | |
void | reset () |
Explicitly reset the timer. More... | |
std::string | str () |
Convert the elapsed time (without reseting) to a string. More... | |
Private Attributes | |
clock_t | m_start |
The starting time (implementation dependent format) More... | |
Timer | m_wallClockTime |
The regular (wall-clock time). More... | |
CPUTimer : Timer that uses the CPU time, rather than wall-clock time to measure execution time.
Definition at line 24 of file CPUTimer.h.
Mantid::Kernel::CPUTimer::CPUTimer | ( | ) |
float Mantid::Kernel::CPUTimer::CPUfraction | ( | bool | doReset = true | ) |
Return the fraction of the CPU used (CPUTime/wall-clock time).
This can be > 1 on multi-CPU systems.
doReset | :: true to reset both timers |
Definition at line 67 of file CPUTimer.cpp.
References Mantid::Kernel::Timer::elapsed(), elapsedCPU(), m_wallClockTime, and reset().
Referenced by str().
float Mantid::Kernel::CPUTimer::elapsedCPU | ( | bool | doReset = true | ) |
Calculate the elapsed CPU time, reseting the timer if specified.
doReset | :: true to reset the timer |
Definition at line 36 of file CPUTimer.cpp.
References m_start, reset(), and UNUSED_ARG.
Referenced by CPUfraction().
float Mantid::Kernel::CPUTimer::elapsedWallClock | ( | bool | doReset = true | ) |
Calculate the elapsed wall-clock time, reseting the timer if specified.
doReset | :: true to reset the timer |
Definition at line 54 of file CPUTimer.cpp.
References Mantid::Kernel::Timer::elapsed(), m_wallClockTime, and reset().
Referenced by Mantid::DataHandling::NexusTester::exec().
void Mantid::Kernel::CPUTimer::reset | ( | ) |
Explicitly reset the timer.
Definition at line 23 of file CPUTimer.cpp.
References m_start, m_wallClockTime, and Mantid::Kernel::Timer::reset().
Referenced by CPUfraction(), CPUTimer(), elapsedCPU(), elapsedWallClock(), Mantid::MDAlgorithms::ConvertToDiffractionMDWorkspace::exec(), and str().
std::string Mantid::Kernel::CPUTimer::str | ( | ) |
Convert the elapsed time (without reseting) to a string.
Definition at line 77 of file CPUTimer.cpp.
References CPUfraction(), Mantid::Kernel::Timer::elapsed_no_reset(), m_wallClockTime, and reset().
|
private |
The starting time (implementation dependent format)
Definition at line 35 of file CPUTimer.h.
Referenced by elapsedCPU(), and reset().
|
private |
The regular (wall-clock time).
Definition at line 38 of file CPUTimer.h.
Referenced by CPUfraction(), elapsedWallClock(), reset(), and str().