Class timer is a simple stop watch timer.
It uses the timestamp() function to get the current time when start() is called. Then, after some processing, the function stop() functions can be called, or seconds() and other accessors can be called directly.
- Examples:
- examples/containers/copy_file.cpp, and examples/containers/sorter2.cpp.
Definition at line 70 of file timer.h.
|
static const bool | is_real = true |
| boolean indicating that this class does real timing More...
|
|
|
std::ostream & | operator<< (std::ostream &os, const timer &t) |
| direct <<-operator for ostream. Can be used for printing with std::cout. More...
|
|
stxxl::timer::timer |
( |
bool |
start_immediately = false | ) |
|
|
inline |
initialize and optionally immediately start the timer
Definition at line 92 of file timer.h.
double stxxl::timer::mseconds |
( |
| ) |
const |
|
inline |
timer& stxxl::timer::operator+= |
( |
const timer & |
tm | ) |
|
|
inline |
accumulate elapsed time from another timer
Definition at line 147 of file timer.h.
References seconds().
void stxxl::timer::reset |
( |
| ) |
|
|
inline |
double stxxl::timer::seconds |
( |
| ) |
const |
|
inline |
void stxxl::timer::start |
( |
| ) |
|
|
inline |
void stxxl::timer::stop |
( |
| ) |
|
|
inline |
static double stxxl::timer::timestamp |
( |
| ) |
|
|
inlinestaticprivate |
double stxxl::timer::useconds |
( |
| ) |
const |
|
inline |
std::ostream& operator<< |
( |
std::ostream & |
os, |
|
|
const timer & |
t |
|
) |
| |
|
friend |
direct <<-operator for ostream. Can be used for printing with std::cout.
Definition at line 157 of file timer.h.
double stxxl::timer::accumulated |
|
private |
total accumulated time in seconds.
Definition at line 76 of file timer.h.
const bool stxxl::timer::is_real = true |
|
static |
boolean indicating that this class does real timing
Definition at line 89 of file timer.h.
double stxxl::timer::last_clock |
|
private |
last start time of the stopwatch
Definition at line 79 of file timer.h.
bool stxxl::timer::running |
|
private |
boolean whether the stopwatch timer is currently running
Definition at line 73 of file timer.h.
The documentation for this class was generated from the following file: