klee
|
#include <Timer.h>
Public Member Functions | |
TimerGroup (const time::Span &minInterval) | |
void | add (std::unique_ptr< Timer > timer) |
void | invoke () |
Invoke registered timers with current time only if minimum interval exceeded. More... | |
void | reset () |
Reset all timers. More... | |
Private Attributes | |
llvm::SmallVector< std::unique_ptr< Timer >, 4 > | timers |
Registered timers. More... | |
Timer | invocationTimer |
Timer that invokes all registered timers after minimum interval. More... | |
time::Point | currentTime |
Time of last invoke call. More... | |
A TimerGroup manages multiple timers.
TimerGroup simplifies the handling of multiple Timer objects by offering a unifying Timer-like interface. Additionally, it serves as a barrier and prevents timers from being invoked too often by defining a minimum invocation interval (MI). All registered timer intervals should be larger than MI and also be multiples of MI. Similar to Timer, a TimerGroup is passive and needs to be invoke
d by an external caller.
|
explicit |
minInterval | The minimum interval between invocations of registered timers. |
Definition at line 50 of file Timer.cpp.
References currentTime, and timers.
void TimerGroup::add | ( | std::unique_ptr< Timer > | timer | ) |
Add a timer to be executed periodically.
timer | The timer object to register. |
Definition at line 60 of file Timer.cpp.
References klee::Timer::getInterval(), invocationTimer, klee::klee_warning(), and timers.
Referenced by klee::Executor::Executor(), and klee::StatsTracker::StatsTracker().
void TimerGroup::invoke | ( | ) |
Invoke registered timers with current time only if minimum interval exceeded.
Definition at line 71 of file Timer.cpp.
References currentTime, klee::time::getWallTime(), invocationTimer, and klee::Timer::invoke().
Referenced by klee::Executor::run().
void TimerGroup::reset | ( | ) |
Reset all timers.
Definition at line 76 of file Timer.cpp.
References currentTime, klee::time::getWallTime(), invocationTimer, klee::Timer::reset(), and timers.
Referenced by klee::Executor::run().
|
private |
Time of last invoke
call.
Definition at line 80 of file Timer.h.
Referenced by invoke(), reset(), and TimerGroup().
|
private |
|
private |
Registered timers.
Definition at line 76 of file Timer.h.
Referenced by add(), reset(), and TimerGroup().