klee
klee::TimerGroup Class Reference

#include <Timer.h>

Collaboration diagram for klee::TimerGroup:

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...
 

Detailed Description

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 invoked by an external caller.

Definition at line 74 of file Timer.h.

Constructor & Destructor Documentation

◆ TimerGroup()

TimerGroup::TimerGroup ( const time::Span minInterval)
explicit
Parameters
minIntervalThe minimum interval between invocations of registered timers.

Definition at line 50 of file Timer.cpp.

References currentTime, and timers.

Member Function Documentation

◆ add()

void TimerGroup::add ( std::unique_ptr< Timer timer)

Add a timer to be executed periodically.

Parameters
timerThe 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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ invoke()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ reset()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ currentTime

time::Point klee::TimerGroup::currentTime
private

Time of last invoke call.

Definition at line 80 of file Timer.h.

Referenced by invoke(), reset(), and TimerGroup().

◆ invocationTimer

Timer klee::TimerGroup::invocationTimer
private

Timer that invokes all registered timers after minimum interval.

Definition at line 78 of file Timer.h.

Referenced by add(), invoke(), and reset().

◆ timers

llvm::SmallVector<std::unique_ptr<Timer>, 4> klee::TimerGroup::timers
private

Registered timers.

Definition at line 76 of file Timer.h.

Referenced by add(), reset(), and TimerGroup().


The documentation for this class was generated from the following files: