Public Member Functions
ash::Bench Class Reference

A lightweight stopwatch class for benchmarking. More...

#include <ash/bench.h>

List of all members.

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.

Detailed Description

A lightweight stopwatch class for benchmarking.


Constructor & Destructor Documentation

ash::Bench::Bench ( std::string const &  name) [inline, explicit]

Constructor.

Parameters:
nameThe name of the block to be benchmarked.

Member Function Documentation

long double ash::Bench::average ( ) const [inline]

Get the average time per iteration.

Returns:
The average in usec.
uint32 ash::Bench::count ( ) const [inline]

Get the number of iterations.

Returns:
the iteration count.
void ash::Bench::reset ( ) [inline]

Reset to the original state.

std::string ash::Bench::result ( ) const [inline]

Get the result for output.

Returns:
The result string.
long double ash::Bench::total ( ) const [inline]

Get the total time for all iterations.

Returns:
The total in usec.

The documentation for this class was generated from the following file:


© 2012   AshTL
Licensed under  AGPLv3
Hosted by  Get AshTL at SourceForge.net. Fast, secure and Free Open Source software downloads
Generated by  doxygen 1.7.4