OOFEM  2.4
OOFEM.org - Object Oriented Finite Element Solver
oofem::Timer Class Reference

Class implementing single timer, providing wall clock and user time capabilities. More...

#include <timer.h>

Public Member Functions

 Timer ()
 
void startTimer ()
 
void stopTimer ()
 
void pauseTimer ()
 
void resumeTimer ()
 
void initTimer ()
 
bool isRunning ()
 
double getUtime ()
 Returns total user time elapsed in seconds. More...
 
double getWtime ()
 Returns total elapsed wall clock time in seconds. More...
 
void toString (char *buff)
 Prints receiver state into a string. More...
 
void updateElapsedTime ()
 

Static Public Member Functions

static void convert2HMS (int &nhrs, int &nmin, int &nsec, double tsec)
 Converts total seconds into hours, minutes and remaining seconds. More...
 

Private Member Functions

void getUtime (std::chrono::duration< double > &answer)
 Platform independent wrapper for user time. More...
 
void getTime (std::chrono::time_point< std::chrono::high_resolution_clock > &answer)
 Platform independent wrapper for wall time. More...
 

Private Attributes

std::chrono::time_point< std::chrono::high_resolution_clock > start_wtime
 Wall clock time markers. More...
 
std::chrono::time_point< std::chrono::high_resolution_clock > end_wtime
 
std::chrono::duration< double > start_utime
 User time. More...
 
std::chrono::duration< double > end_utime
 
std::chrono::duration< double > elapsedWTime
 Accumulated wtime and utime (in seconds) from start. More...
 
std::chrono::duration< double > elapsedUTime
 
bool running
 Flag indicating whether timer is running. More...
 

Detailed Description

Class implementing single timer, providing wall clock and user time capabilities.

Definition at line 46 of file timer.h.

Constructor & Destructor Documentation

oofem::Timer::Timer ( )

Definition at line 64 of file timer.C.

References initTimer().

Member Function Documentation

void oofem::Timer::convert2HMS ( int &  nhrs,
int &  nmin,
int &  nsec,
double  tsec 
)
static

Converts total seconds into hours, minutes and remaining seconds.

Parameters
[out]nhrsNumber of hours.
[out]nminNumber of minutes.
[out]nsecNumber of seconds.
[in]tsecTotal time in seconds.

Definition at line 117 of file timer.C.

Referenced by oofem::EngngModelTimer::convert2HMS().

void oofem::Timer::getTime ( std::chrono::time_point< std::chrono::high_resolution_clock > &  answer)
private

Platform independent wrapper for wall time.

Definition at line 59 of file timer.C.

Referenced by pauseTimer(), resumeTimer(), and startTimer().

void oofem::Timer::getUtime ( std::chrono::duration< double > &  answer)
private

Platform independent wrapper for user time.

Definition at line 47 of file timer.C.

double oofem::Timer::getWtime ( )

Returns total elapsed wall clock time in seconds.

Definition at line 111 of file timer.C.

References elapsedWTime, and updateElapsedTime().

Referenced by oofem::SuperLUSolver::solve(), and toString().

void oofem::Timer::initTimer ( )

Definition at line 98 of file timer.C.

References elapsedUTime, elapsedWTime, and running.

Referenced by oofem::EngngModelTimer::initTimer(), startTimer(), and Timer().

bool oofem::Timer::isRunning ( )
inline

Definition at line 65 of file timer.h.

void oofem::Timer::toString ( char *  buff)

Prints receiver state into a string.

Definition at line 135 of file timer.C.

References getUtime(), and getWtime().

void oofem::Timer::updateElapsedTime ( )

Member Data Documentation

std :: chrono :: duration< double > oofem::Timer::elapsedUTime
private

Definition at line 53 of file timer.h.

Referenced by getUtime(), initTimer(), and updateElapsedTime().

std :: chrono :: duration< double > oofem::Timer::elapsedWTime
private

Accumulated wtime and utime (in seconds) from start.

Definition at line 53 of file timer.h.

Referenced by getWtime(), initTimer(), and updateElapsedTime().

std :: chrono :: duration< double > oofem::Timer::end_utime
private

Definition at line 51 of file timer.h.

Referenced by pauseTimer(), and updateElapsedTime().

std :: chrono :: time_point< std :: chrono :: high_resolution_clock > oofem::Timer::end_wtime
private

Definition at line 49 of file timer.h.

Referenced by pauseTimer(), and updateElapsedTime().

bool oofem::Timer::running
private

Flag indicating whether timer is running.

Definition at line 55 of file timer.h.

Referenced by initTimer(), pauseTimer(), resumeTimer(), startTimer(), stopTimer(), and updateElapsedTime().

std :: chrono :: duration< double > oofem::Timer::start_utime
private

User time.

Definition at line 51 of file timer.h.

Referenced by resumeTimer(), startTimer(), and updateElapsedTime().

std :: chrono :: time_point< std :: chrono :: high_resolution_clock > oofem::Timer::start_wtime
private

Wall clock time markers.

Definition at line 49 of file timer.h.

Referenced by resumeTimer(), startTimer(), and updateElapsedTime().


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

This page is part of the OOFEM documentation. Copyright (c) 2011 Borek Patzak
Project e-mail: info@oofem.org
Generated at Tue Jan 2 2018 20:07:42 for OOFEM by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2011