dune-fem 2.8.0
Loading...
Searching...
No Matches
Classes | Public Types | Public Member Functions | Static Public Member Functions | List of all members
Dune::Fem::Timer< true > Struct Reference

#include <dune/fem/misc/femtimer.hh>

Public Types

enum  operation { max , sum }
 

Public Member Functions

 Timer ()
 
 ~Timer ()
 

Static Public Member Functions

static void start ()
 push a new timer to the stack
 
static double stop ()
 retrieve a timer from the stack
 
static unsigned int addTo (const std::string &name, int nr=0)
 
static void removeFrom (unsigned int id)
 remove a timer with given id
 
static void removeAll ()
 remove all timers
 
static void start (int id, int nr=0)
 
static double stop (int id, int nr=0, operation op=sum)
 
static double stop (int id, operation op)
 
static void reset ()
 reset all timers to zero
 
static void reset (int id)
 reset a given timer with all its subtimers
 
static void reset (int id, int nr)
 rest a given subtimer
 
static void print (std::ostream &out, int id)
 print the values of a given timer (plus subtimers) to a stream
 
static void print (std::ostream &out, const std::string &msg="")
 print the values of all timers to a stream
 
static void printFile (const std::string &fileName, int step=1)
 
static void printFile (const TimeProviderBase &tp, const std::string &fileName, int step=1)
 

Member Enumeration Documentation

◆ operation

enum Dune::Fem::Timer< true >::operation
Enumerator
max 
sum 

Constructor & Destructor Documentation

◆ Timer()

Dune::Fem::Timer< true >::Timer ( )

◆ ~Timer()

Dune::Fem::Timer< true >::~Timer ( )
inline

Member Function Documentation

◆ addTo()

static unsigned int Dune::Fem::Timer< true >::addTo ( const std::string &  name,
int  nr = 0 
)
inlinestatic

add a new timer with description

Parameters
namedescription for output
nrnumber of subtimers to store
Returns
id used to identify this timer in all following calls

◆ print() [1/2]

static void Dune::Fem::Timer< true >::print ( std::ostream &  out,
const std::string &  msg = "" 
)
inlinestatic

print the values of all timers to a stream

◆ print() [2/2]

static void Dune::Fem::Timer< true >::print ( std::ostream &  out,
int  id 
)
inlinestatic

print the values of a given timer (plus subtimers) to a stream

◆ printFile() [1/2]

static void Dune::Fem::Timer< true >::printFile ( const std::string &  fileName,
int  step = 1 
)
inlinestatic

print the values of all timers to a file if the file is open a new line is appended

Parameters
fileNamename of the file
steponly add a line to the file each step calls of this method

◆ printFile() [2/2]

static void Dune::Fem::Timer< true >::printFile ( const TimeProviderBase tp,
const std::string &  fileName,
int  step = 1 
)
inlinestatic

print the values of all timers to a file if the file is open a new line is appended information taken from a time provider is also added to the file

Parameters
tpthe time provider
fileNamename of the file
steponly add a line to the file each step calls of this method

◆ removeAll()

static void Dune::Fem::Timer< true >::removeAll ( )
inlinestatic

remove all timers

◆ removeFrom()

static void Dune::Fem::Timer< true >::removeFrom ( unsigned int  id)
inlinestatic

remove a timer with given id

◆ reset() [1/3]

static void Dune::Fem::Timer< true >::reset ( )
inlinestatic

reset all timers to zero

◆ reset() [2/3]

static void Dune::Fem::Timer< true >::reset ( int  id)
inlinestatic

reset a given timer with all its subtimers

◆ reset() [3/3]

static void Dune::Fem::Timer< true >::reset ( int  id,
int  nr 
)
inlinestatic

rest a given subtimer

◆ start() [1/2]

static void Dune::Fem::Timer< true >::start ( )
inlinestatic

push a new timer to the stack

◆ start() [2/2]

static void Dune::Fem::Timer< true >::start ( int  id,
int  nr = 0 
)
inlinestatic

start a given timer (or subtimer)

Parameters
idthe id returned by the method addTo
nrthe number of the subtimer

◆ stop() [1/3]

static double Dune::Fem::Timer< true >::stop ( )
inlinestatic

retrieve a timer from the stack

◆ stop() [2/3]

static double Dune::Fem::Timer< true >::stop ( int  id,
int  nr = 0,
operation  op = sum 
)
inlinestatic

stop a given timer (or subtimer)

Parameters
idthe id of the timer as returned by the method addTo
nrthe number of the subtimer
opthe operation to perform (sum or max)
Returns
the total (or max) time used by this timer since the last reset

◆ stop() [3/3]

static double Dune::Fem::Timer< true >::stop ( int  id,
operation  op 
)
inlinestatic

stop a given timer (with subtimer 0)

Parameters
idthe id of the timer as returned by the method addTo
opthe operation to perform (sum or max)
Returns
the total (or max) time used by this timer since the last reset

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