|
TBCI Numerical high perf. C++ Library
2.8.0
|
base class for all the stop watches to minimize code duplication More...
#include <stopwatch.h>

Public Member Functions | |
| stopw_base (const double tick, const double over=-1.0) | |
| c'tor More... | |
| virtual | ~stopw_base () |
| d'tor More... | |
| double | reset () |
| Resets the stopwatch. More... | |
| void | start () |
| Starts the stopwatch. More... | |
| double | stop () |
| Stops the stopwatch and returns total time (since last reset) More... | |
| double | stop_d () |
| Stops the stopwatch and returns time since last start / read. More... | |
| double | read () |
| Returns the total time without stopping the stopwatch (but resets the differential timer) More... | |
| double | read_d () |
| Returns the time since last read/start without stopping the stopwatch (but resets the differential timer) More... | |
Protected Member Functions | |
| virtual double | seconds () const |
| Return the current time, to be overriden in derived classes. More... | |
| double | adv_stopwatch () |
| Advance the stopwatch, return diff, handle single overflows. More... | |
Protected Attributes | |
| double | last_time |
| The last time we read/started/stopped the clock. More... | |
| double | total |
| The total elapsed time since construction or reset. More... | |
| const double | secs_per_tick |
| Used in seconds() to convert internal time to s. More... | |
| const double | overflow_secs |
| If we overflow once, we miss this many seconds; We assume that internally long ints are used, i.e. More... | |
| int | running |
| The status. More... | |
base class for all the stop watches to minimize code duplication
Definition at line 86 of file stopwatch.h.
|
inline |
c'tor
Definition at line 127 of file stopwatch.h.
|
inlinevirtual |
d'tor
Definition at line 135 of file stopwatch.h.
|
inlineprotected |
Advance the stopwatch, return diff, handle single overflows.
Definition at line 109 of file stopwatch.h.
References last_time, overflow_secs, seconds(), secs_per_tick, and total.
Referenced by read(), read_d(), start(), stop(), and stop_d().
|
inline |
Returns the total time without stopping the stopwatch (but resets the differential timer)
Definition at line 173 of file stopwatch.h.
References adv_stopwatch(), running, and total.
|
inline |
Returns the time since last read/start without stopping the stopwatch (but resets the differential timer)
Definition at line 181 of file stopwatch.h.
References adv_stopwatch(), and running.
|
inline |
Resets the stopwatch.
Definition at line 137 of file stopwatch.h.
|
inlineprotectedvirtual |
Return the current time, to be overriden in derived classes.
Reimplemented in stopwatch_e, stopwatch_us, and stopwatch_u.
Definition at line 104 of file stopwatch.h.
References secs_per_tick.
Referenced by adv_stopwatch(), and start().
|
inline |
Starts the stopwatch.
Definition at line 145 of file stopwatch.h.
References adv_stopwatch(), last_time, running, and seconds().
|
inline |
Stops the stopwatch and returns total time (since last reset)
Definition at line 153 of file stopwatch.h.
References adv_stopwatch(), running, and total.
|
inline |
Stops the stopwatch and returns time since last start / read.
Definition at line 162 of file stopwatch.h.
References adv_stopwatch(), and running.
|
protected |
The last time we read/started/stopped the clock.
Definition at line 90 of file stopwatch.h.
Referenced by adv_stopwatch(), reset(), and start().
|
protected |
If we overflow once, we miss this many seconds; We assume that internally long ints are used, i.e.
32bit counters on 32bit machines, 64bit on 64bit archs.
Definition at line 99 of file stopwatch.h.
Referenced by adv_stopwatch().
|
protected |
|
protected |
Used in seconds() to convert internal time to s.
Definition at line 94 of file stopwatch.h.
Referenced by adv_stopwatch(), seconds(), stopwatch_u::seconds(), and stopwatch_us::seconds().
|
protected |
The total elapsed time since construction or reset.
Definition at line 92 of file stopwatch.h.
Referenced by adv_stopwatch(), read(), reset(), and stop().
1.8.5