2002-10-01 19:36:54 +00:00
|
|
|
//===-- Timer.cpp - Interval Timing Support -------------------------------===//
|
2005-04-21 22:55:34 +00:00
|
|
|
//
|
2003-10-20 19:43:21 +00:00
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
2007-12-29 20:36:04 +00:00
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
2005-04-21 22:55:34 +00:00
|
|
|
//
|
2003-10-20 19:43:21 +00:00
|
|
|
//===----------------------------------------------------------------------===//
|
2002-10-01 19:36:54 +00:00
|
|
|
//
|
|
|
|
// Interval Timing implementation.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2004-09-01 22:55:40 +00:00
|
|
|
#include "llvm/Support/Timer.h"
|
|
|
|
#include "llvm/Support/CommandLine.h"
|
2010-03-29 21:28:41 +00:00
|
|
|
#include "llvm/Support/Debug.h"
|
2006-10-04 21:52:35 +00:00
|
|
|
#include "llvm/Support/ManagedStatic.h"
|
2009-08-23 08:43:55 +00:00
|
|
|
#include "llvm/Support/raw_ostream.h"
|
|
|
|
#include "llvm/Support/Format.h"
|
2010-03-29 21:28:41 +00:00
|
|
|
#include "llvm/System/Mutex.h"
|
2004-12-20 00:59:04 +00:00
|
|
|
#include "llvm/System/Process.h"
|
2003-10-06 15:02:31 +00:00
|
|
|
#include <map>
|
2003-12-14 21:27:33 +00:00
|
|
|
using namespace llvm;
|
2003-05-09 20:05:44 +00:00
|
|
|
|
2004-06-07 19:34:51 +00:00
|
|
|
// GetLibSupportInfoOutputFile - Return a file stream to print our output on.
|
2009-08-23 08:43:55 +00:00
|
|
|
namespace llvm { extern raw_ostream *GetLibSupportInfoOutputFile(); }
|
2003-11-11 22:41:34 +00:00
|
|
|
|
2003-07-31 19:38:34 +00:00
|
|
|
// getLibSupportInfoOutputFilename - This ugly hack is brought to you courtesy
|
|
|
|
// of constructor/destructor ordering being unspecified by C++. Basically the
|
2006-12-06 17:46:33 +00:00
|
|
|
// problem is that a Statistic object gets destroyed, which ends up calling
|
2003-07-31 19:38:34 +00:00
|
|
|
// 'GetLibSupportInfoOutputFile()' (below), which calls this function.
|
|
|
|
// LibSupportInfoOutputFilename used to be a global variable, but sometimes it
|
2004-12-14 03:55:21 +00:00
|
|
|
// would get destroyed before the Statistic, causing havoc to ensue. We "fix"
|
|
|
|
// this by creating the string the first time it is needed and never destroying
|
|
|
|
// it.
|
2006-10-04 21:52:35 +00:00
|
|
|
static ManagedStatic<std::string> LibSupportInfoOutputFilename;
|
2003-07-31 19:38:34 +00:00
|
|
|
static std::string &getLibSupportInfoOutputFilename() {
|
2004-12-14 03:55:21 +00:00
|
|
|
return *LibSupportInfoOutputFilename;
|
2003-07-31 19:38:34 +00:00
|
|
|
}
|
2002-10-01 19:36:54 +00:00
|
|
|
|
2009-06-23 20:52:29 +00:00
|
|
|
static ManagedStatic<sys::SmartMutex<true> > TimerLock;
|
|
|
|
|
2003-01-30 23:08:50 +00:00
|
|
|
namespace {
|
2008-04-23 23:15:23 +00:00
|
|
|
static cl::opt<bool>
|
2003-01-30 23:08:50 +00:00
|
|
|
TrackSpace("track-memory", cl::desc("Enable -time-passes memory "
|
|
|
|
"tracking (this may be slow)"),
|
|
|
|
cl::Hidden);
|
2003-05-09 20:05:44 +00:00
|
|
|
|
2008-04-23 23:15:23 +00:00
|
|
|
static cl::opt<std::string, true>
|
2003-08-01 22:15:15 +00:00
|
|
|
InfoOutputFilename("info-output-file", cl::value_desc("filename"),
|
2003-05-09 20:05:44 +00:00
|
|
|
cl::desc("File to append -stats and -timer output to"),
|
2003-07-31 19:38:34 +00:00
|
|
|
cl::Hidden, cl::location(getLibSupportInfoOutputFilename()));
|
2003-01-30 23:08:50 +00:00
|
|
|
}
|
|
|
|
|
2010-03-29 21:34:06 +00:00
|
|
|
// GetLibSupportInfoOutputFile - Return a file stream to print our output on.
|
|
|
|
raw_ostream *llvm::GetLibSupportInfoOutputFile() {
|
|
|
|
std::string &LibSupportInfoOutputFilename = getLibSupportInfoOutputFilename();
|
|
|
|
if (LibSupportInfoOutputFilename.empty())
|
|
|
|
return &errs();
|
|
|
|
if (LibSupportInfoOutputFilename == "-")
|
|
|
|
return &outs();
|
|
|
|
|
|
|
|
std::string Error;
|
|
|
|
raw_ostream *Result = new raw_fd_ostream(LibSupportInfoOutputFilename.c_str(),
|
|
|
|
Error, raw_fd_ostream::F_Append);
|
|
|
|
if (Error.empty())
|
|
|
|
return Result;
|
|
|
|
|
|
|
|
errs() << "Error opening info-output-file '"
|
|
|
|
<< LibSupportInfoOutputFilename << " for appending!\n";
|
|
|
|
delete Result;
|
|
|
|
return &errs();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2009-06-23 16:36:10 +00:00
|
|
|
static TimerGroup *DefaultTimerGroup = 0;
|
2002-10-01 19:36:54 +00:00
|
|
|
static TimerGroup *getDefaultTimerGroup() {
|
2010-03-29 20:35:01 +00:00
|
|
|
TimerGroup *tmp = DefaultTimerGroup;
|
2009-06-23 17:33:37 +00:00
|
|
|
sys::MemoryFence();
|
2010-03-29 20:35:01 +00:00
|
|
|
if (tmp) return tmp;
|
|
|
|
|
|
|
|
llvm_acquire_global_lock();
|
|
|
|
tmp = DefaultTimerGroup;
|
2009-06-23 17:33:37 +00:00
|
|
|
if (!tmp) {
|
2010-03-29 20:35:01 +00:00
|
|
|
tmp = new TimerGroup("Miscellaneous Ungrouped Timers");
|
|
|
|
sys::MemoryFence();
|
|
|
|
DefaultTimerGroup = tmp;
|
2009-06-23 17:33:37 +00:00
|
|
|
}
|
2010-03-29 20:35:01 +00:00
|
|
|
llvm_release_global_lock();
|
2009-11-07 06:33:12 +00:00
|
|
|
|
2009-06-23 17:33:37 +00:00
|
|
|
return tmp;
|
2002-10-01 19:36:54 +00:00
|
|
|
}
|
|
|
|
|
2010-03-29 20:35:01 +00:00
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// Timer Implementation
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2010-03-30 03:57:00 +00:00
|
|
|
Timer::Timer(const std::string &N)
|
|
|
|
: Elapsed(0), UserTime(0), SystemTime(0), MemUsed(0), Name(N),
|
|
|
|
Started(false), TG(getDefaultTimerGroup()) {
|
2002-10-01 19:36:54 +00:00
|
|
|
TG->addTimer();
|
|
|
|
}
|
|
|
|
|
2010-03-30 03:57:00 +00:00
|
|
|
Timer::Timer(const std::string &N, TimerGroup &tg)
|
|
|
|
: Elapsed(0), UserTime(0), SystemTime(0), MemUsed(0), Name(N),
|
|
|
|
Started(false), TG(&tg) {
|
2002-10-01 19:36:54 +00:00
|
|
|
TG->addTimer();
|
|
|
|
}
|
|
|
|
|
2010-03-30 03:57:00 +00:00
|
|
|
Timer::Timer(const Timer &T) {
|
|
|
|
TG = T.TG;
|
|
|
|
if (TG) TG->addTimer();
|
|
|
|
operator=(T);
|
|
|
|
}
|
|
|
|
|
|
|
|
// Copy ctor, initialize with no TG member.
|
|
|
|
Timer::Timer(bool, const Timer &T) {
|
|
|
|
TG = T.TG; // Avoid assertion in operator=
|
|
|
|
operator=(T); // Copy contents
|
|
|
|
TG = 0;
|
|
|
|
}
|
|
|
|
|
2002-10-01 19:36:54 +00:00
|
|
|
Timer::~Timer() {
|
2010-03-30 03:57:00 +00:00
|
|
|
if (!TG) return;
|
2010-03-29 20:35:01 +00:00
|
|
|
|
|
|
|
if (Started) {
|
|
|
|
Started = false;
|
2010-03-30 03:57:00 +00:00
|
|
|
TG->addTimerToPrint(*this);
|
2002-10-01 19:36:54 +00:00
|
|
|
}
|
2010-03-29 20:35:01 +00:00
|
|
|
TG->removeTimer();
|
2002-10-01 19:36:54 +00:00
|
|
|
}
|
|
|
|
|
2005-01-08 20:15:57 +00:00
|
|
|
static inline size_t getMemUsage() {
|
2004-12-27 08:03:04 +00:00
|
|
|
if (TrackSpace)
|
2005-01-08 20:15:57 +00:00
|
|
|
return sys::Process::GetMallocUsage();
|
2004-12-27 08:03:04 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2010-03-30 03:57:00 +00:00
|
|
|
struct TimeRecord {
|
|
|
|
double Elapsed, UserTime, SystemTime;
|
|
|
|
ssize_t MemUsed;
|
|
|
|
};
|
|
|
|
|
|
|
|
static TimeRecord getTimeRecord(bool Start) {
|
2004-12-20 00:59:04 +00:00
|
|
|
TimeRecord Result;
|
2004-06-07 19:34:51 +00:00
|
|
|
|
2004-12-20 00:59:04 +00:00
|
|
|
sys::TimeValue now(0,0);
|
|
|
|
sys::TimeValue user(0,0);
|
|
|
|
sys::TimeValue sys(0,0);
|
2004-06-07 19:34:51 +00:00
|
|
|
|
2009-06-23 20:17:22 +00:00
|
|
|
ssize_t MemUsed = 0;
|
2004-12-20 21:44:27 +00:00
|
|
|
if (Start) {
|
2004-12-27 08:03:04 +00:00
|
|
|
MemUsed = getMemUsage();
|
2010-03-29 20:35:01 +00:00
|
|
|
sys::Process::GetTimeUsage(now, user, sys);
|
2004-12-20 21:44:27 +00:00
|
|
|
} else {
|
2010-03-29 20:35:01 +00:00
|
|
|
sys::Process::GetTimeUsage(now, user, sys);
|
2005-03-22 03:20:38 +00:00
|
|
|
MemUsed = getMemUsage();
|
2004-12-20 21:44:27 +00:00
|
|
|
}
|
2002-11-18 21:47:09 +00:00
|
|
|
|
2010-03-30 03:57:00 +00:00
|
|
|
Result.Elapsed = now.seconds() + now.microseconds() / 1000000.0;
|
2010-03-29 20:35:01 +00:00
|
|
|
Result.UserTime = user.seconds() + user.microseconds() / 1000000.0;
|
2010-03-30 03:57:00 +00:00
|
|
|
Result.SystemTime = sys.seconds() + sys.microseconds() / 1000000.0;
|
2010-03-29 20:35:01 +00:00
|
|
|
Result.MemUsed = MemUsed;
|
2002-10-01 19:36:54 +00:00
|
|
|
return Result;
|
|
|
|
}
|
|
|
|
|
2006-10-04 21:52:35 +00:00
|
|
|
static ManagedStatic<std::vector<Timer*> > ActiveTimers;
|
2002-11-18 21:47:09 +00:00
|
|
|
|
2002-10-01 19:36:54 +00:00
|
|
|
void Timer::startTimer() {
|
|
|
|
Started = true;
|
2008-06-24 22:07:07 +00:00
|
|
|
ActiveTimers->push_back(this);
|
2010-03-30 03:57:00 +00:00
|
|
|
TimeRecord TR = getTimeRecord(true);
|
|
|
|
Elapsed -= TR.Elapsed;
|
|
|
|
UserTime -= TR.UserTime;
|
|
|
|
SystemTime -= TR.SystemTime;
|
|
|
|
MemUsed -= TR.MemUsed;
|
2002-10-01 19:36:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void Timer::stopTimer() {
|
2010-03-30 03:57:00 +00:00
|
|
|
TimeRecord TR = getTimeRecord(false);
|
|
|
|
Elapsed += TR.Elapsed;
|
|
|
|
UserTime += TR.UserTime;
|
|
|
|
SystemTime += TR.SystemTime;
|
|
|
|
MemUsed += TR.MemUsed;
|
2002-11-18 21:47:09 +00:00
|
|
|
|
2006-10-04 21:52:35 +00:00
|
|
|
if (ActiveTimers->back() == this) {
|
|
|
|
ActiveTimers->pop_back();
|
2002-11-18 21:47:09 +00:00
|
|
|
} else {
|
|
|
|
std::vector<Timer*>::iterator I =
|
2006-10-04 21:52:35 +00:00
|
|
|
std::find(ActiveTimers->begin(), ActiveTimers->end(), this);
|
|
|
|
assert(I != ActiveTimers->end() && "stop but no startTimer?");
|
|
|
|
ActiveTimers->erase(I);
|
2002-11-18 21:47:09 +00:00
|
|
|
}
|
2002-10-01 19:36:54 +00:00
|
|
|
}
|
|
|
|
|
2010-03-30 03:57:00 +00:00
|
|
|
void Timer::sum(const Timer &T) {
|
|
|
|
Elapsed += T.Elapsed;
|
|
|
|
UserTime += T.UserTime;
|
|
|
|
SystemTime += T.SystemTime;
|
|
|
|
MemUsed += T.MemUsed;
|
|
|
|
}
|
|
|
|
|
|
|
|
const Timer &Timer::operator=(const Timer &T) {
|
|
|
|
Elapsed = T.Elapsed;
|
|
|
|
UserTime = T.UserTime;
|
|
|
|
SystemTime = T.SystemTime;
|
|
|
|
MemUsed = T.MemUsed;
|
|
|
|
Name = T.Name;
|
|
|
|
Started = T.Started;
|
|
|
|
assert(TG == T.TG && "Can only assign timers in the same TimerGroup!");
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2010-03-29 20:35:01 +00:00
|
|
|
static void printVal(double Val, double Total, raw_ostream &OS) {
|
2010-03-29 20:40:19 +00:00
|
|
|
if (Total < 1e-7) // Avoid dividing by zero.
|
2010-03-29 20:35:01 +00:00
|
|
|
OS << " ----- ";
|
|
|
|
else {
|
|
|
|
OS << " " << format("%7.4f", Val) << " (";
|
|
|
|
OS << format("%5.1f", Val*100/Total) << "%)";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-03-30 03:57:00 +00:00
|
|
|
void Timer::print(const Timer &Total, raw_ostream &OS) {
|
|
|
|
if (Total.UserTime)
|
|
|
|
printVal(UserTime, Total.UserTime, OS);
|
|
|
|
if (Total.SystemTime)
|
|
|
|
printVal(SystemTime, Total.SystemTime, OS);
|
2010-03-29 20:35:01 +00:00
|
|
|
if (Total.getProcessTime())
|
|
|
|
printVal(getProcessTime(), Total.getProcessTime(), OS);
|
2010-03-30 03:57:00 +00:00
|
|
|
printVal(Elapsed, Total.Elapsed, OS);
|
2010-03-29 20:35:01 +00:00
|
|
|
|
|
|
|
OS << " ";
|
|
|
|
|
2010-03-30 03:57:00 +00:00
|
|
|
if (Total.MemUsed)
|
|
|
|
OS << format("%9lld", (long long)MemUsed) << " ";
|
|
|
|
|
|
|
|
OS << Name << "\n";
|
|
|
|
|
|
|
|
Started = false; // Once printed, don't print again
|
2010-03-29 20:35:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2003-10-06 15:02:31 +00:00
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// NamedRegionTimer Implementation
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2010-03-30 03:57:00 +00:00
|
|
|
typedef std::map<std::string, Timer> Name2Timer;
|
|
|
|
typedef std::map<std::string, std::pair<TimerGroup, Name2Timer> > Name2Pair;
|
2008-07-14 18:19:29 +00:00
|
|
|
|
2010-03-30 03:57:00 +00:00
|
|
|
static ManagedStatic<Name2Timer> NamedTimers;
|
|
|
|
static ManagedStatic<Name2Pair> NamedGroupedTimers;
|
2003-10-06 15:02:31 +00:00
|
|
|
|
2006-10-04 21:52:35 +00:00
|
|
|
static Timer &getNamedRegionTimer(const std::string &Name) {
|
2009-07-07 18:33:04 +00:00
|
|
|
sys::SmartScopedLock<true> L(*TimerLock);
|
2010-03-30 03:57:00 +00:00
|
|
|
Name2Timer::iterator I = NamedTimers->find(Name);
|
|
|
|
if (I != NamedTimers->end())
|
|
|
|
return I->second;
|
|
|
|
|
|
|
|
return NamedTimers->insert(I, std::make_pair(Name, Timer(Name)))->second;
|
2003-10-06 15:02:31 +00:00
|
|
|
}
|
|
|
|
|
2008-07-14 18:19:29 +00:00
|
|
|
static Timer &getNamedRegionTimer(const std::string &Name,
|
|
|
|
const std::string &GroupName) {
|
2009-07-07 18:33:04 +00:00
|
|
|
sys::SmartScopedLock<true> L(*TimerLock);
|
2008-07-14 18:19:29 +00:00
|
|
|
|
2010-03-30 03:57:00 +00:00
|
|
|
Name2Pair::iterator I = NamedGroupedTimers->find(GroupName);
|
|
|
|
if (I == NamedGroupedTimers->end()) {
|
|
|
|
TimerGroup TG(GroupName);
|
|
|
|
std::pair<TimerGroup, Name2Timer> Pair(TG, Name2Timer());
|
|
|
|
I = NamedGroupedTimers->insert(I, std::make_pair(GroupName, Pair));
|
|
|
|
}
|
2008-07-14 18:19:29 +00:00
|
|
|
|
2010-03-30 03:57:00 +00:00
|
|
|
Name2Timer::iterator J = I->second.second.find(Name);
|
|
|
|
if (J == I->second.second.end())
|
|
|
|
J = I->second.second.insert(J,
|
|
|
|
std::make_pair(Name,
|
|
|
|
Timer(Name,
|
|
|
|
I->second.first)));
|
2008-07-14 18:19:29 +00:00
|
|
|
|
2010-03-30 03:57:00 +00:00
|
|
|
return J->second;
|
2008-07-14 18:19:29 +00:00
|
|
|
}
|
|
|
|
|
2003-10-06 15:02:31 +00:00
|
|
|
NamedRegionTimer::NamedRegionTimer(const std::string &Name)
|
|
|
|
: TimeRegion(getNamedRegionTimer(Name)) {}
|
|
|
|
|
2008-07-14 18:19:29 +00:00
|
|
|
NamedRegionTimer::NamedRegionTimer(const std::string &Name,
|
|
|
|
const std::string &GroupName)
|
|
|
|
: TimeRegion(getNamedRegionTimer(Name, GroupName)) {}
|
2002-11-18 21:47:09 +00:00
|
|
|
|
2002-10-01 19:36:54 +00:00
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// TimerGroup Implementation
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
void TimerGroup::removeTimer() {
|
2009-07-07 18:33:04 +00:00
|
|
|
sys::SmartScopedLock<true> L(*TimerLock);
|
2010-03-29 20:35:01 +00:00
|
|
|
if (--NumTimers != 0 || TimersToPrint.empty())
|
|
|
|
return; // Don't print timing report.
|
|
|
|
|
|
|
|
// Sort the timers in descending order by amount of time taken.
|
2010-03-30 03:57:00 +00:00
|
|
|
std::sort(TimersToPrint.begin(), TimersToPrint.end(),
|
|
|
|
std::greater<Timer>());
|
2002-10-01 19:36:54 +00:00
|
|
|
|
2010-03-29 20:35:01 +00:00
|
|
|
// Figure out how many spaces to indent TimerGroup name.
|
|
|
|
unsigned Padding = (80-Name.length())/2;
|
|
|
|
if (Padding > 80) Padding = 0; // Don't allow "negative" numbers
|
2003-05-09 20:05:44 +00:00
|
|
|
|
2010-03-29 20:35:01 +00:00
|
|
|
raw_ostream *OutStream = GetLibSupportInfoOutputFile();
|
|
|
|
|
2010-03-30 03:57:00 +00:00
|
|
|
++NumTimers;
|
|
|
|
{ // Scope to contain Total timer: don't allow total timer to drop us to
|
|
|
|
// zero timers.
|
|
|
|
Timer Total("TOTAL");
|
|
|
|
|
|
|
|
for (unsigned i = 0, e = TimersToPrint.size(); i != e; ++i)
|
|
|
|
Total.sum(TimersToPrint[i]);
|
|
|
|
|
|
|
|
// Print out timing header.
|
|
|
|
*OutStream << "===" << std::string(73, '-') << "===\n"
|
|
|
|
<< std::string(Padding, ' ') << Name << "\n"
|
|
|
|
<< "===" << std::string(73, '-')
|
|
|
|
<< "===\n";
|
|
|
|
|
|
|
|
// If this is not an collection of ungrouped times, print the total time.
|
|
|
|
// Ungrouped timers don't really make sense to add up. We still print the
|
|
|
|
// TOTAL line to make the percentages make sense.
|
|
|
|
if (this != DefaultTimerGroup) {
|
|
|
|
*OutStream << " Total Execution Time: ";
|
|
|
|
*OutStream << format("%5.4f", Total.getProcessTime()) << " seconds (";
|
|
|
|
*OutStream << format("%5.4f", Total.getWallTime()) << " wall clock)\n";
|
|
|
|
}
|
|
|
|
*OutStream << "\n";
|
|
|
|
|
|
|
|
if (Total.UserTime)
|
|
|
|
*OutStream << " ---User Time---";
|
|
|
|
if (Total.SystemTime)
|
|
|
|
*OutStream << " --System Time--";
|
|
|
|
if (Total.getProcessTime())
|
|
|
|
*OutStream << " --User+System--";
|
|
|
|
*OutStream << " ---Wall Time---";
|
|
|
|
if (Total.getMemUsed())
|
|
|
|
*OutStream << " ---Mem---";
|
|
|
|
*OutStream << " --- Name ---\n";
|
|
|
|
|
|
|
|
// Loop through all of the timing data, printing it out.
|
|
|
|
for (unsigned i = 0, e = TimersToPrint.size(); i != e; ++i)
|
|
|
|
TimersToPrint[i].print(Total, *OutStream);
|
|
|
|
|
|
|
|
Total.print(Total, *OutStream);
|
|
|
|
*OutStream << '\n';
|
|
|
|
OutStream->flush();
|
2010-03-30 02:38:19 +00:00
|
|
|
}
|
2010-03-30 03:57:00 +00:00
|
|
|
--NumTimers;
|
2010-03-29 20:35:01 +00:00
|
|
|
|
|
|
|
TimersToPrint.clear();
|
|
|
|
|
2010-03-29 21:24:52 +00:00
|
|
|
if (OutStream != &errs() && OutStream != &outs())
|
2010-03-29 20:40:19 +00:00
|
|
|
delete OutStream; // Close the file.
|
2002-10-01 19:36:54 +00:00
|
|
|
}
|
2003-11-11 22:41:34 +00:00
|
|
|
|
2009-06-23 20:52:29 +00:00
|
|
|
void TimerGroup::addTimer() {
|
2009-07-07 18:33:04 +00:00
|
|
|
sys::SmartScopedLock<true> L(*TimerLock);
|
2009-06-23 20:52:29 +00:00
|
|
|
++NumTimers;
|
|
|
|
}
|
|
|
|
|
2010-03-30 03:57:00 +00:00
|
|
|
void TimerGroup::addTimerToPrint(const Timer &T) {
|
2009-07-07 18:33:04 +00:00
|
|
|
sys::SmartScopedLock<true> L(*TimerLock);
|
2010-03-30 03:57:00 +00:00
|
|
|
TimersToPrint.push_back(Timer(true, T));
|
2009-06-23 20:52:29 +00:00
|
|
|
}
|
|
|
|
|