SOFA API  6a688117
Open source framework for multi-physics simuation
sofa::helper::TSimpleTimer< nIter, nStep > Class Template Reference

#include <SimpleTimer.h>

Detailed Description

template<int nIter = 100, int nStep = 100>
class sofa::helper::TSimpleTimer< nIter, nStep >

Very simple timer

Usage example :

sofa::helper::SimpleTimer mytimer;

void myComputationCode() {

bool timer = true; // should I print performance stats if (timer) mytimer.start("mystep1);

... // step 1 code

if (timer) mytimer.step("mystep2");

... // step 2 code

if (timer) mytimer.stop(); }

Public Attributes

ctime_t timer_total
 
ctime_t timer_current
 
ctime_t timer_freq
 
ctime_t timer_start
 
ctime_t timers_start
 
const char * timers_name [T_NSTEPS]
 
ctime_t timers_total [T_NSTEPS]
 
ctime_t timers_current [T_NSTEPS]
 
int timer_niter
 
int timer_nstep
 
const char * timer_lastname
 

Public Member Functions

 TSimpleTimer ()
 
void start (const char *name)
 
void step (const char *name="")
 
void stop ()
 

Attribute details

template<int nIter = 100, int nStep = 100>
ctime_t sofa::helper::TSimpleTimer< nIter, nStep >::timer_current
template<int nIter = 100, int nStep = 100>
ctime_t sofa::helper::TSimpleTimer< nIter, nStep >::timer_freq
template<int nIter = 100, int nStep = 100>
const char* sofa::helper::TSimpleTimer< nIter, nStep >::timer_lastname
template<int nIter = 100, int nStep = 100>
int sofa::helper::TSimpleTimer< nIter, nStep >::timer_niter
template<int nIter = 100, int nStep = 100>
int sofa::helper::TSimpleTimer< nIter, nStep >::timer_nstep
template<int nIter = 100, int nStep = 100>
ctime_t sofa::helper::TSimpleTimer< nIter, nStep >::timer_start
template<int nIter = 100, int nStep = 100>
ctime_t sofa::helper::TSimpleTimer< nIter, nStep >::timer_total
template<int nIter = 100, int nStep = 100>
ctime_t sofa::helper::TSimpleTimer< nIter, nStep >::timers_current[T_NSTEPS]
template<int nIter = 100, int nStep = 100>
const char* sofa::helper::TSimpleTimer< nIter, nStep >::timers_name[T_NSTEPS]
template<int nIter = 100, int nStep = 100>
ctime_t sofa::helper::TSimpleTimer< nIter, nStep >::timers_start
template<int nIter = 100, int nStep = 100>
ctime_t sofa::helper::TSimpleTimer< nIter, nStep >::timers_total[T_NSTEPS]

Constructor details

template<int nIter = 100, int nStep = 100>
sofa::helper::TSimpleTimer< nIter, nStep >::TSimpleTimer ( )
inline

Function details

template<int nIter = 100, int nStep = 100>
void sofa::helper::TSimpleTimer< nIter, nStep >::start ( const char *  name)
inline
template<int nIter = 100, int nStep = 100>
void sofa::helper::TSimpleTimer< nIter, nStep >::step ( const char *  name = "")
inline
template<int nIter = 100, int nStep = 100>
void sofa::helper::TSimpleTimer< nIter, nStep >::stop ( )
inline

Enum details

template<int nIter = 100, int nStep = 100>
anonymous enum
Enumerator
T_NSTEPS 
T_NITERS