45 #include "Moocho_ConfigDefs.hpp"
47 namespace StopWatchPack {
63 stopwatch() : running_(false), last_time_(0.0), total_(0.0)
74 last_time_ = seconds();
82 total_ += seconds() - last_time_;
99 double curr_time = seconds();
100 total_ += curr_time - last_time_;
101 last_time_ = curr_time;
void reset()
Stops and resets the clock if it is running.
void start()
Starts timing if it has already not been started.
stopwatch()
Initializes of not running.
bool is_running() const
Returns true if this is currently timming.
double stop()
Stops timing and returns the time (sec.) since start() was called.
double read()
Reads the elapsed time (sec.) and leaves the clock running.