#include <Timer.hpp>
Static Public Member Functions | |
static void | Reset () |
static void | Print (std::string message) |
static void | PrintAndReset (std::string message) |
Static Private Attributes | |
static time_t | StartTime |
Usage:
Timer::Reset(); //do something Timer::PrintAndReset("First thing"); //do something else Timer::Print("Other thing");
which outputs (for example):
First thing time: 10s Other thing time: 2s
Definition at line 54 of file Timer.hpp.
void Timer::Reset | ( | ) | [static] |
Reset the timer.
Definition at line 36 of file Timer.cpp.
References StartTime.
Referenced by DistributedTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::ConstructFromMeshReader(), DistributedTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::MetisLibraryNodePartitioning(), DistributedTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::ParMetisLibraryNodePartitioning(), DistributedTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::PetscMatrixPartitioning(), PrintAndReset(), LinearSystem::Solve(), and AbstractNonlinearElasticitySolver< COMPRESSIBILITY_TYPE, DIM >::TakeNewtonStep().
void Timer::Print | ( | std::string | message | ) | [static] |
Print the elapsed time (to std::cout and the Log file (under logging-level 2) preceded by the message provided.
message |
Definition at line 41 of file Timer.cpp.
References StartTime.
Referenced by PrintAndReset(), and LinearSystem::Solve().
void Timer::PrintAndReset | ( | std::string | message | ) | [static] |
Print the elapsed time (to std::cout and the Log file (under logging-level 2) preceded by the message provided, and also reset the timer.
message |
Definition at line 48 of file Timer.cpp.
References Print(), and Reset().
Referenced by DistributedTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::ComputeMeshPartitioning(), DistributedTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::PetscMatrixPartitioning(), and AbstractNonlinearElasticitySolver< COMPRESSIBILITY_TYPE, DIM >::TakeNewtonStep().
time_t Timer::StartTime [static, private] |