LocARNA-1.9.2
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends
Classes | Public Member Functions
LocARNA::StopWatch Class Reference

control a set of named stop watch like timers More...

#include <stopwatch.hh>

List of all members.

Classes

struct  timer_t

Public Member Functions

 StopWatch (bool print_on_exit=false)
 Constructor.
 ~StopWatch ()
 Destructor.
void set_print_on_exit (bool print_on_exit)
bool start (const std::string &name)
 start a named timer
bool stop (const std::string &name)
 stop a named timer
bool is_running (const std::string &name) const
 test whether named timer is running
double current_total (const std::string &name) const
 current total time of a named timer
size_t current_cycles (const std::string &name) const
 current start/stop cycles of a named timer
std::ostream & print_info (std::ostream &out, const std::string &name) const
 print information for one timer
std::ostream & print_info (std::ostream &out) const
 print information for all timers

Detailed Description

control a set of named stop watch like timers


Constructor & Destructor Documentation

LocARNA::StopWatch::StopWatch ( bool  print_on_exit = false) [explicit]

Constructor.

Parameters:
print_on_exitwhether to automatically print times on exit

Member Function Documentation

size_t LocARNA::StopWatch::current_cycles ( const std::string &  name) const

current start/stop cycles of a named timer

Parameters:
nametimer name
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:
nametimer name
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:
nametimer name
Returns:
running?
std::ostream & LocARNA::StopWatch::print_info ( std::ostream &  out,
const std::string &  name 
) const

print information for one timer

Parameters:
outoutput stream
name
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:
outoutput stream
Returns:
output stream
void LocARNA::StopWatch::set_print_on_exit ( bool  print_on_exit)

Control automatic printing of times at exit

Parameters:
print_on_exitwhether to print on exit
bool LocARNA::StopWatch::start ( const std::string &  name)

start a named timer

Parameters:
nametimer name
Returns:
success
bool LocARNA::StopWatch::stop ( const std::string &  name)

stop a named timer

Parameters:
nametimer name
Returns:
success

The documentation for this class was generated from the following files:
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends