OGS 6.2.2-87-g988ee9c30.dirty.20200123122242
BaseLib::RunTime Class Reference

Detailed Description

Count the running time.

Definition at line 31 of file RunTime.h.

#include <RunTime.h>

Public Member Functions

void start ()
 Start the timer. More...
 
double elapsed () const
 Get the elapsed time after started. More...
 

Private Attributes

double _start_time = 0.
 

Member Function Documentation

◆ elapsed()

double BaseLib::RunTime::elapsed ( ) const
inline

Get the elapsed time after started.

Definition at line 51 of file RunTime.h.

References _start_time.

Referenced by ProcessLib::Output::doOutputAlways(), ProcessLib::Output::doOutputNonlinearIteration(), ProcessLib::TimeLoop::initialize(), ProcessLib::TimeLoop::loop(), main(), MeshLib::IO::NodePartitionedMeshReader::read(), MathLib::PETScLinearSolver::solve(), NumLib::NonlinearSolver< NonlinearSolverTag::Newton >::solve(), NumLib::NonlinearSolver< NonlinearSolverTag::Picard >::solve(), ProcessLib::TimeLoop::solveCoupledEquationSystemsByStaggeredScheme(), and ProcessLib::solveMonolithicProcess().

52  {
53 #if defined(USE_MPI)
54  return MPI_Wtime() - _start_time;
55 #else
56 #ifndef WIN32
57  timeval t;
58  gettimeofday(&t, nullptr);
59  return t.tv_sec + t.tv_usec/1000000.0 - _start_time;
60 #else
61  return (timeGetTime() - _start_time)/1000.0;
62 #endif
63 #endif
64  }
double _start_time
Definition: RunTime.h:67

◆ start()

void BaseLib::RunTime::start ( )
inline

Member Data Documentation

◆ _start_time

double BaseLib::RunTime::_start_time = 0.
private

Definition at line 67 of file RunTime.h.

Referenced by elapsed(), and start().


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