#include <timer.h>
List of all members.
Detailed Description
Provides a simple timer class which uses cvd_timer internally. Statistics (average, max and min cycle time) are kept and output for a number of timing cycles. Cycle times are stored in a std::deque<double> and statistics only calculated when the get or print functions are called.
Definition at line 89 of file timer.h.
Constructor & Destructor Documentation
CVD::SimpleTimer::SimpleTimer |
( |
const std::string & |
description, |
|
|
const int & |
cycles_to_time = 1 , |
|
|
bool |
output = true , |
|
|
std::ostream & |
out = std::cout | |
|
) |
| | [inline] |
Create a simple timer object.
- Parameters:
-
| description | A string description of what is being timed (used in output) |
| cycles_to_time | How many cycles to time before the times are averaged and output (default 1). |
| output | Whether or not to output timing information. Default is true. |
| out | std::ostream to send output information to. Default std::cout. |
Definition at line 97 of file timer.h.
CVD::SimpleTimer::~SimpleTimer |
( |
|
) |
[inline] |
Member Function Documentation
void CVD::SimpleTimer::click |
( |
|
) |
[inline] |
Begin or end a timing cycle. Automatically calls print() when cycles_to_time cycles are reached.
Definition at line 110 of file timer.h.
double CVD::SimpleTimer::get_average |
( |
|
) |
[inline] |
Calculate the average cycle time as double.
Definition at line 170 of file timer.h.
double CVD::SimpleTimer::get_max |
( |
|
) |
[inline] |
Calculate the max cycle time as double.
Definition at line 146 of file timer.h.
double CVD::SimpleTimer::get_min |
( |
|
) |
[inline] |
Calculate the min cycle time as double.
Definition at line 159 of file timer.h.
void CVD::SimpleTimer::print |
( |
|
) |
[inline] |
Output timing information (average, maximum and minimum times for a set of cycles). Automatically called after cycles_to_time cycles but can be called manually.
Definition at line 132 of file timer.h.
Member Data Documentation
The documentation for this class was generated from the following file:
libcvd
Author(s): Edward Rosten, Paul Smith, Tom Drummond, Gerhard Reitmayr, Ethan Eade, Timothy Gan, Chris Kemp, Georg Klein
autogenerated on Fri Jan 11 09:13:52 2013