ReFRACtor
FullPhysics::AccumulatedTimer Class Reference

This is a simple timer class that can be used to accumulate the time spent in multiple calls to a function. More...

#include <accumulated_timer.h>

+ Inheritance diagram for FullPhysics::AccumulatedTimer:
+ Collaboration diagram for FullPhysics::AccumulatedTimer:

Public Member Functions

 AccumulatedTimer (const std::string &Desc)
 Create an AccumulatedTimer. More...
 
double elapsed () const
 Total elapsed time. More...
 
FunctionTimer function_timer (bool Auto_log=false) const
 Function timer. More...
 
void print (std::ostream &Os) const
 
std::string print_to_string () const
 Print to string. More...
 
void reset_elapsed ()
 Reset elapsed time to 0. More...
 

Friends

class FunctionTimerR
 

Detailed Description

This is a simple timer class that can be used to accumulate the time spent in multiple calls to a function.

You get a function timer from this class, which keeps track of the time that object exists and adds it to the elapsed time.

Definition at line 19 of file accumulated_timer.h.

Constructor & Destructor Documentation

◆ AccumulatedTimer()

FullPhysics::AccumulatedTimer::AccumulatedTimer ( const std::string &  Desc)
inline

Create an AccumulatedTimer.

The description is printed out when you print this object.

Definition at line 27 of file accumulated_timer.h.

Member Function Documentation

◆ elapsed()

double FullPhysics::AccumulatedTimer::elapsed ( ) const
inline

Total elapsed time.

Definition at line 33 of file accumulated_timer.h.

◆ function_timer()

FunctionTimer FullPhysics::AccumulatedTimer::function_timer ( bool  Auto_log = false) const
inline

Function timer.

Definition at line 88 of file accumulated_timer.h.

◆ print()

void FullPhysics::AccumulatedTimer::print ( std::ostream &  Os) const
inline

Definition at line 46 of file accumulated_timer.h.

◆ print_to_string()

std::string FullPhysics::Printable< AccumulatedTimer >::print_to_string ( ) const
inlineinherited

Print to string.

This is primarily useful for SWIG wrappers to this class, e.g. a to_s method in ruby.

Definition at line 31 of file printable.h.

◆ reset_elapsed()

void FullPhysics::AccumulatedTimer::reset_elapsed ( )
inline

Reset elapsed time to 0.

Definition at line 39 of file accumulated_timer.h.

Friends And Related Function Documentation

◆ FunctionTimerR

friend class FunctionTimerR
friend

Definition at line 51 of file accumulated_timer.h.


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

Copyright © 2017, California Institute of Technology.
ALL RIGHTS RESERVED.
U.S. Government Sponsorship acknowledged.
Generated Fri Aug 24 2018 15:44:11