#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 double | msStartTime = 0.0 |
A very simple lightweight benchmarking tool. Call Timer::Reset() to reset the timer and Timer::Print() to print the time elapsed to stdout.
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 58 of file Timer.hpp.
| void Timer::Print | ( | std::string | message | ) | [static] |
Print the elapsed wall-clock time (to std::cout and the Log file (under logging-level 2)) preceded by the message provided.
| message |
Definition at line 49 of file Timer.cpp.
References PetscTools::GetMyRank(), PetscTools::IsParallel(), and msStartTime.
Referenced by PrintAndReset(), and LinearSystem::Solve().
| void Timer::PrintAndReset | ( | std::string | message | ) | [static] |
Print the elapsed wall-clock 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 60 of file Timer.cpp.
References Print(), and Reset().
Referenced by DistributedTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::ComputeMeshPartitioning(), NodePartitioner< ELEMENT_DIM, SPACE_DIM >::PetscMatrixPartitioning(), StokesFlowSolver< DIM >::Solve(), and AbstractNonlinearElasticitySolver< DIM >::TakeNewtonStep().
| void Timer::Reset | ( | ) | [static] |
Reset the timer.
Definition at line 44 of file Timer.cpp.
References msStartTime.
Referenced by DistributedTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::ConstructFromMeshReader(), NodePartitioner< ELEMENT_DIM, SPACE_DIM >::MetisLibraryPartitioning(), DistributedTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::ParMetisLibraryNodeAndElementPartitioning(), NodePartitioner< ELEMENT_DIM, SPACE_DIM >::PetscMatrixPartitioning(), PrintAndReset(), LinearSystem::Solve(), StokesFlowSolver< DIM >::Solve(), and AbstractNonlinearElasticitySolver< DIM >::TakeNewtonStep().
double Timer::msStartTime = 0.0 [static, private] |
1.6.2