ivutils
Loading...
Searching...
No Matches
apTimer Class Reference

Timer that can be started, stopped and measure its working time usually timer corresponds to some process, for example solving number of equations timer can be part of some timers hierarchy which corresponds to hierarchy of processes, for example solving of some equations is part of modeling of some physical process (upper level process), but it has as a part solving of one particular equation (lower level process). More...

#include <component.h>

Public Member Functions

 apTimer (int started=0, apTimer *parent_=NULL)
 number of started timers of lower level plus this timer
 
apTimerbind (apTimer *p)
 attach timer p to the list of upper level timers parentv
 
int start (double t0_=-1)
 if timer is not started, start this timer and all timers of upper level
 
int stop (int force=0, double tset_=-1)
 if all lower level timers are stopped, stop timer and inform upper level timers about this if force, stop timer and upper level timers

 
double update ()
 updates time and t0. returns time
 

Static Public Member Functions

static double gettime (bool local=true)
 
If local==true, it will be time on current processor, otherwise time on zero processor of mpi.
 

Detailed Description

Timer that can be started, stopped and measure its working time usually timer corresponds to some process, for example solving number of equations timer can be part of some timers hierarchy which corresponds to hierarchy of processes, for example solving of some equations is part of modeling of some physical process (upper level process), but it has as a part solving of one particular equation (lower level process).

hierarchy of timers should correspond this hierarchy of processes. starting lower level timer causes starting upper level timers, so upper level timers should summate time measured by their lower level timers.

Member Function Documentation

◆ gettime()

static double apTimer::gettime ( bool  local = true)
static


If local==true, it will be time on current processor, otherwise time on zero processor of mpi.

If USE_MPI is not defined it fallbacks to real time, mesured by high_resolution_clock.

Returns
current time in seconds.

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