|
Mantid
|
A simple class that provides a wall-clock (not processor time) timer. More...
#include <Timer.h>
Public Member Functions | |
| float | elapsed (bool reset=true) |
| Returns the wall-clock time elapsed in seconds since the Timer object's creation, or the last call to elapsed. More... | |
| float | elapsed_no_reset () const |
| Returns the wall-clock time elapsed in seconds since the Timer object's creation, or the last call to elapsed. More... | |
| void | reset () |
| Explicitly reset the timer. More... | |
| std::string | str () const |
| Convert the elapsed time (without reseting) to a string. More... | |
| Timer () | |
| Constructor. More... | |
| virtual | ~Timer ()=default |
Private Attributes | |
| time_point_ns | m_start |
| The starting time. More... | |
A simple class that provides a wall-clock (not processor time) timer.
| Mantid::Kernel::Timer::Timer | ( | ) |
|
virtualdefault |
| float Mantid::Kernel::Timer::elapsed | ( | bool | reset = true | ) |
Returns the wall-clock time elapsed in seconds since the Timer object's creation, or the last call to elapsed.
| reset | :: set to true to reset the clock (default) |
Definition at line 28 of file Timer.cpp.
References elapsed_no_reset(), and reset().
Referenced by Mantid::Kernel::CPUTimer::CPUfraction(), Mantid::API::Algorithm::doCallProcessGroups(), Mantid::Kernel::CPUTimer::elapsedWallClock(), Mantid::API::Algorithm::executeInternal(), Mantid::MDAlgorithms::LoadSQW2::readPixelDataIntoWorkspace(), Mantid::MDAlgorithms::LoadSQW2::setupBoxController(), and Mantid::DataHandling::SaveToSNSHistogramNexus::WriteOutDataOrErrors().
| float Mantid::Kernel::Timer::elapsed_no_reset | ( | ) | const |
Returns the wall-clock time elapsed in seconds since the Timer object's creation, or the last call to elapsed.
Definition at line 40 of file Timer.cpp.
References m_start.
Referenced by elapsed(), MantidQt::MantidWidgets::NotificationService::showMessage(), Mantid::Kernel::CPUTimer::str(), str(), and MantidQt::MantidWidgets::AlgorithmProgressPresenter::updateProgressBarSlot().
| void Mantid::Kernel::Timer::reset | ( | ) |
Explicitly reset the timer.
Definition at line 48 of file Timer.cpp.
References m_start.
Referenced by elapsed(), Mantid::Kernel::CPUTimer::reset(), MantidQt::MantidWidgets::NotificationService::showMessage(), and MantidQt::MantidWidgets::AlgorithmProgressPresenter::updateProgressBarSlot().
| std::string Mantid::Kernel::Timer::str | ( | ) | const |
Convert the elapsed time (without reseting) to a string.
Definition at line 51 of file Timer.cpp.
References elapsed_no_reset().
|
private |
The starting time.
Definition at line 38 of file Timer.h.
Referenced by elapsed_no_reset(), and reset().