1 #ifndef LOCARNA_STOPWATCH_HH 2 #define LOCARNA_STOPWATCH_HH 25 timer_t(): running(
false), last_start(0.0), total(0.0), cycles(0) {}
67 start(
const std::string &name);
77 stop(
const std::string &name);
119 print_info(std::ostream &out,
const std::string &name)
const;
133 double current_time ()
const;
StopWatch(bool print_on_exit=false)
Constructor.
Definition: stopwatch.cc:13
bool stop(const std::string &name)
stop a named timer
Definition: stopwatch.cc:40
Definition: aligner.cc:17
std::ostream & print_info(std::ostream &out, const std::string &name) const
print information for one timer
Definition: stopwatch.cc:84
~StopWatch()
Destructor.
Definition: stopwatch.cc:16
bool start(const std::string &name)
start a named timer
Definition: stopwatch.cc:28
bool is_running(const std::string &name) const
test whether named timer is running
Definition: stopwatch.cc:55
void set_print_on_exit(bool print_on_exit)
Definition: stopwatch.cc:23
size_t current_cycles(const std::string &name) const
current start/stop cycles of a named timer
Definition: stopwatch.cc:73
double current_total(const std::string &name) const
current total time of a named timer
Definition: stopwatch.cc:63
control a set of named stop watch like timers
Definition: stopwatch.hh:17