#include <timer.hh>
Collaboration diagram for oln::utils::timer:
Public Member Functions | |
timer () | |
void | start () |
float | restart () |
void | resume () |
float | stop () |
float | last_time () const |
Time since the last resume() or start(). | |
float | total_time () const |
Total time elapsed. |
Definition at line 39 of file timer.hh.
oln::utils::timer::timer | ( | ) | [inline] |
void oln::utils::timer::start | ( | ) | [inline] |
float oln::utils::timer::restart | ( | ) | [inline] |
Restart the timer.
Definition at line 72 of file timer.hh.
References start(), and total_time().
00073 { 00074 assertion(status_ != e_unknown); 00075 float val = total_time(); 00076 status_ = e_stopped; 00077 start(); 00078 return val; 00079 }
void oln::utils::timer::resume | ( | ) | [inline] |
float oln::utils::timer::stop | ( | ) | [inline] |
Stop the timer.
Definition at line 98 of file timer.hh.
References total_time().
00099 { 00100 assertion(status_ == e_running); 00101 stop_time_ = clock(); 00102 total_time_ += (stop_time_ - start_time_); 00103 status_ = e_stopped; 00104 return total_time(); 00105 }