control a set of named stop watch like timers
More...
#include <stopwatch.hh>
control a set of named stop watch like timers
LocARNA::StopWatch::StopWatch |
( |
bool |
print_on_exit = false | ) |
|
|
explicit |
Constructor.
- Parameters
-
print_on_exit | whether to automatically print times on exit |
size_t LocARNA::StopWatch::current_cycles |
( |
const std::string & |
name | ) |
const |
current start/stop cycles of a named timer
- Parameters
-
- Returns
- cycles (including started cycle if running)
double LocARNA::StopWatch::current_total |
( |
const std::string & |
name | ) |
const |
current total time of a named timer
- Parameters
-
- Returns
- time (if running add time since start)
bool LocARNA::StopWatch::is_running |
( |
const std::string & |
name | ) |
const |
test whether named timer is running
- Parameters
-
- Returns
- running?
std::ostream & LocARNA::StopWatch::print_info |
( |
std::ostream & |
out, |
|
|
const std::string & |
name |
|
) |
| const |
print information for one timer
- Parameters
-
- Note
- determine current running time for running timers
- Returns
- output stream
std::ostream & LocARNA::StopWatch::print_info |
( |
std::ostream & |
out | ) |
const |
print information for all timers
- Parameters
-
- Returns
- output stream
void LocARNA::StopWatch::set_print_on_exit |
( |
bool |
print_on_exit | ) |
|
Control automatic printing of times at exit
- Parameters
-
print_on_exit | whether to print on exit |
bool LocARNA::StopWatch::start |
( |
const std::string & |
name | ) |
|
start a named timer
- Parameters
-
- Returns
- success
bool LocARNA::StopWatch::stop |
( |
const std::string & |
name | ) |
|
stop a named timer
- Parameters
-
- Returns
- success
The documentation for this class was generated from the following files: