netxsimdg
Loading...
Searching...
No Matches
ScopedTimer.cpp
Go to the documentation of this file.
1
9
10namespace Nextsim {
11Timer* ScopedTimer::p_timer;
12
13ScopedTimer::ScopedTimer()
14 : ScopedTimer("")
15{
16}
17
18ScopedTimer::ScopedTimer(const std::string& name) { p_timer->tick(name); }
19
20ScopedTimer::~ScopedTimer() { p_timer->tock(); }
21
22void ScopedTimer::substitute(const std::string& newName)
23{
24 p_timer->tock();
25 p_timer->tick(newName);
26}
27
28void ScopedTimer::setTimerAddress(Timer* timer) { p_timer = timer; }
29
30Timer& ScopedTimer::timer() { return *p_timer; }
31}
A class for a hierarchical timer functions.
Definition Timer.hpp:23