Adobe Source Libraries 1.49.0
A collection of C++ libraries.
Loading...
Searching...
No Matches
timer_t Class Reference

#include <timer.hpp>

Inheritance diagram for timer_t:

Public Types

typedef accumulator_type::size_type size_type

Public Member Functions

 timer_t ()
 timer_t (const timer_t &rhs)
timer_toperator= (const timer_t &rhs)
void reset ()
void reset_accumulator ()
double split ()
void accrue ()
double accrued_min () const
double accrued_max () const
double accrued_average () const
double accrued_median () const
double accrued_total () const
size_type size () const
bool empty () const
void report (const char *decoration, std::ostream &s=std::cout)

Friends

bool operator== (const timer_t &x, const timer_t &y)
bool operator< (const timer_t &x, const timer_t &y)

Detailed Description

Definition at line 122 of file timer.hpp.

Member Typedef Documentation

◆ size_type

typedef accumulator_type::size_type size_type

Definition at line 128 of file timer.hpp.

Constructor & Destructor Documentation

◆ timer_t() [1/2]

timer_t ( )

Definition at line 132 of file timer.hpp.

◆ timer_t() [2/2]

timer_t ( const timer_t & rhs)

Definition at line 136 of file timer.hpp.

Member Function Documentation

◆ operator=()

timer_t & operator= ( const timer_t & rhs)

Definition at line 141 of file timer.hpp.

◆ reset()

void reset ( )

Resets the epoch of the timer to now

Definition at line 155 of file timer.hpp.

◆ reset_accumulator()

void reset_accumulator ( )

Resets the split time accumulator

Definition at line 163 of file timer.hpp.

◆ split()

double split ( )
Returns
The difference of time between the epoch and now, in milliseconds

Definition at line 170 of file timer.hpp.

◆ accrue()

void accrue ( )

Grabs a new split time and stores it in the accumulator.

Definition at line 180 of file timer.hpp.

◆ accrued_min()

double accrued_min ( ) const
Returns
The smallest of the split times in the accumulator, in milliseconds

Definition at line 190 of file timer.hpp.

◆ accrued_max()

double accrued_max ( ) const
Returns
The largest of the split times in the accumulator, in milliseconds

Definition at line 197 of file timer.hpp.

◆ accrued_average()

double accrued_average ( ) const
Returns
The average of the split times in the accumulator, in milliseconds

Definition at line 204 of file timer.hpp.

◆ accrued_median()

double accrued_median ( ) const
Returns
The median of the split times in the accumulator, in milliseconds

Definition at line 211 of file timer.hpp.

◆ accrued_total()

double accrued_total ( ) const
Returns
The summation of the split times in the accumulator, in milliseconds

Definition at line 228 of file timer.hpp.

◆ size()

size_type size ( ) const
Returns
The number of split times in the accumulator

Definition at line 235 of file timer.hpp.

◆ empty()

bool empty ( ) const
Returns
Whether or not there are any split times in the accumulator

Definition at line 242 of file timer.hpp.

◆ report()

void report ( const char * decoration,
std::ostream & s = std::cout )

An archaic utility function that takes a new split time and outputs it to a stream

Parameters
decorationAn identifier to apply to the split time.
sThe stream to which output is written. Defaults to std::cout

Definition at line 252 of file timer.hpp.

◆ operator==

bool operator== ( const timer_t & x,
const timer_t & y )
friend

Definition at line 276 of file timer.hpp.

◆ operator<

bool operator< ( const timer_t & x,
const timer_t & y )
friend

Definition at line 280 of file timer.hpp.