SOFA API  ca665544
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 chartimers_name [T_NSTEPS]
 
ctime_t timers_total [T_NSTEPS]
 
ctime_t timers_current [T_NSTEPS]
 
int timer_niter
 
int timer_nstep
 
const chartimer_lastname
 

Public Member Functions

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

Attribute details

◆ timer_current

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

◆ timer_freq

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

◆ timer_lastname

template<int nIter = 100, int nStep = 100>
const char* sofa::helper::TSimpleTimer< nIter, nStep >::timer_lastname

◆ timer_niter

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

◆ timer_nstep

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

◆ timer_start

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

◆ timer_total

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

◆ timers_current

template<int nIter = 100, int nStep = 100>
ctime_t sofa::helper::TSimpleTimer< nIter, nStep >::timers_current[T_NSTEPS]

◆ timers_name

template<int nIter = 100, int nStep = 100>
const char* sofa::helper::TSimpleTimer< nIter, nStep >::timers_name[T_NSTEPS]

◆ timers_start

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

◆ timers_total

template<int nIter = 100, int nStep = 100>
ctime_t sofa::helper::TSimpleTimer< nIter, nStep >::timers_total[T_NSTEPS]

Constructor details

◆ TSimpleTimer()

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

Function details

◆ start()

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

◆ step()

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

◆ stop()

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

Enum details

◆ anonymous enum

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