1#ifndef TimeAccumulate_hxx
2#define TimeAccumulate_hxx
32 mStart(
Timer::getTimeMs())
39 Lock lock(TimeAccumulate::mMutex);
41 Accumulator& acc = TimeAccumulate::mTimes[mName];
51 TimeAccumulate(
const Data& name)
63 Lock lock(TimeAccumulate::mMutex);
64 return TimeAccumulate::mTimes[name].totalTime;
69 Lock lock(TimeAccumulate::mMutex);
70 return TimeAccumulate::mTimes[name].count;
80 : mAccumulator(accumulator)
94 typedef std::map<Data, Accumulator> TimeMap;
100 static TimeMap mTimes;
An alternative to std::string, encapsulates an arbitrary buffer of bytes.
Guard(uint64_t &accumulator)
Accumulates time and count by distinct string.
static uint64_t getTime(const Data &name)
static size_t getCount(const Data &name)
TimeAccumulate(const Data &name)
This class is used to get the current system time.
static uint64_t getTimeMs()
Returns the current clock time in milliseconds.
dcm! – add UnusedChecking(_enum) below;
std::mutex Mutex
A semaphore that can be locked by only one thread at a time.
std::unique_lock< Mutex > Lock
A convenience class to lock a Lockable (such as a Mutex) on object creation, and unlock on destructio...
unsigned long long uint64_t