25 double elapsed_time();
30 CTimer() : running(false), start_clock(0), start_time(0), acc_time(0) { }
34 void start(
const char* msg = 0);
36 void restart(
const char* msg = 0);
38 void stop(
const char* msg = 0);
43 void check(
const char* msg = 0);
51 return (clock() -
start_clock) / (1.0 * CLOCKS_PER_SEC);
53 return (1.0 * acc_sec);
98 std::stringstream String;
100 if (msg) String << msg <<
" : ";
102 String <<
"Elapsed time [" << std::setiosflags(std::ios::fixed)
103 << std::setprecision(2)
112 os << std::setprecision(2) << std::setiosflags(std::ios::fixed)
Class used to meaure the amount of time it takes to perform a certain task.
void stop(const char *msg=0)
Stop the timer and print an optional message.
void restart(const char *msg=0)
Turn the timer off and start it again from 0. Print an optional message.
void check(const char *msg=0)
void start(const char *msg=0)
Namespace containing a series of customised math operations not found in the standard c++ library.
ostream & operator<<(ostream &output, CMatrix &Matrix)