A lightweight stopwatch class for benchmarking. More...
#include <ash/bench.h>
Public Member Functions | |
Bench (std::string const &name) | |
Constructor. | |
void | start () |
Start the timer for an iteration. | |
void | stop () |
Stop the timer after an iteration. | |
long double | total () const |
Get the total time for all iterations. | |
long double | average () const |
Get the average time per iteration. | |
uint32 | count () const |
Get the number of iterations. | |
std::string | result () const |
Get the result for output. | |
void | reset () |
Reset to the original state. |
A lightweight stopwatch class for benchmarking.
ash::Bench::Bench | ( | std::string const & | name | ) | [inline, explicit] |
Constructor.
name | The name of the block to be benchmarked. |
long double ash::Bench::average | ( | ) | const [inline] |
Get the average time per iteration.
uint32 ash::Bench::count | ( | ) | const [inline] |
Get the number of iterations.
void ash::Bench::reset | ( | ) | [inline] |
Reset to the original state.
std::string ash::Bench::result | ( | ) | const [inline] |
Get the result for output.
long double ash::Bench::total | ( | ) | const [inline] |
Get the total time for all iterations.
© 2012 | Licensed under | Hosted by | Generated by 1.7.4 |