SyTen
syten::Timer Class Reference

A simple timing class, shift into an ostream for results. More...

#include <timer.h>

+ Collaboration diagram for syten::Timer:

Public Member Functions

void add (std::string const &description)
 add a new segment description More...
 
template<typename... Args>
void add (std::string const &description, Args... descs)
 add a set of segment descriptions More...
 
MemoryUsage::MemorySize allocSize () const
 allocSize() implementation More...
 
void end (Index which)
 end a segment measurement and add times to the numbered specified segment More...
 
void end (std::string const &which)
 end a segment measurement and add times to the named specified segment More...
 
void middle (Index which)
 end a segment measurement, add times to the numbered specified segment and start a new segment measurement More...
 
void middle (std::string const &which)
 end a segment measurement, add times to the named specified segment and start a new segment measurement More...
 
template<class Archive >
void serialize (Archive &ar, const unsigned int)
 Boost serialisation support. More...
 
void start ()
 start a segment measurement More...
 
 Timer ()=default
 Default constructor. More...
 
template<typename... Args>
 Timer (Args... segments)
 Constructor adding all gives timer segments. More...
 
std::string total_only () const
 Returns a string describing the total runtime only. More...
 

Private Attributes

std::vector< SRDefcpu_times
 cpu times accumulated in individual segments so far More...
 
std::vector< std::stringdescriptions
 list of descriptions for individual segments More...
 
std::vector< SRDefwall_times
 wall times accumulated in individual segments so far More...
 

Friends

std::ostreamoperator<< (std::ostream &out, Timer const &timer)
 calculate totals, percentages and writes results to the stream More...
 

Detailed Description

A simple timing class, shift into an ostream for results.


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