![]() |
Chaste Commit::333233612e3dcc941d260418acd7b5ccdc30390e
|
#include <Timer.hpp>
Static Public Member Functions | |
static void | Reset () |
static void | Print (std::string message) |
static double | GetElapsedTime () |
static double | GetWallTime () |
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
|
static |
Get the elapsed wall-clock time since since midnight of January 1, 1970, or since Reset() was called.
Definition at line 54 of file Timer.cpp.
References GetWallTime(), and msStartTime.
Referenced by AbstractConvergenceTester< CELL, CARDIAC_PROBLEM, DIM, PROBLEM_DIM >::Converge(), GenericEventHandler< NUM_EVENTS, CONCRETE >::MilliSleep(), and Print().
|
static |
Definition at line 49 of file Timer.cpp.
Referenced by GenericEventHandler< NUM_EVENTS, CONCRETE >::BeginEventImpl(), GenericEventHandler< NUM_EVENTS, CONCRETE >::EndEventImpl(), GetElapsedTime(), GenericEventHandler< NUM_EVENTS, CONCRETE >::GetElapsedTimeImpl(), and Reset().
|
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 59 of file Timer.cpp.
References GetElapsedTime(), PetscTools::GetMyRank(), and PetscTools::IsParallel().
Referenced by PrintAndReset(), LinearSystem::Solve(), and AbstractCellBasedWithTimingsTestSuite::tearDown().
|
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 70 of file Timer.cpp.
References Print(), and Reset().
Referenced by DistributedTetrahedralMesh< DIM, DIM >::GetProcessRegion(), NodePartitioner< ELEMENT_DIM, SPACE_DIM >::PetscMatrixPartitioning(), StokesFlowSolver< DIM >::Solve(), and AbstractNonlinearElasticitySolver< DIM >::TakeNewtonStep().
|
static |
Reset the timer.
Definition at line 44 of file Timer.cpp.
References GetWallTime(), and msStartTime.
Referenced by AbstractConvergenceTester< CELL, CARDIAC_PROBLEM, DIM, PROBLEM_DIM >::Converge(), DistributedTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::ParMetisLibraryNodeAndElementPartitioning(), NodePartitioner< ELEMENT_DIM, SPACE_DIM >::PetscMatrixPartitioning(), PrintAndReset(), AbstractCellBasedWithTimingsTestSuite::setUp(), StokesFlowSolver< DIM >::Solve(), LinearSystem::Solve(), and AbstractNonlinearElasticitySolver< DIM >::TakeNewtonStep().
|
staticprivate |
The start time.
Definition at line 63 of file Timer.hpp.
Referenced by GetElapsedTime(), and Reset().