10 #ifndef LLVM_SUPPORT_TIMER_H
11 #define LLVM_SUPPORT_TIMER_H
15 #include "llvm/Support/DataTypes.h"
33 TimeRecord() : WallTime(0), UserTime(0), SystemTime(0), MemUsed(0) {}
51 return WallTime < T.WallTime;
55 WallTime += RHS.WallTime;
56 UserTime += RHS.UserTime;
57 SystemTime += RHS.SystemTime;
58 MemUsed += RHS.MemUsed;
61 WallTime -= RHS.WallTime;
62 UserTime -= RHS.UserTime;
63 SystemTime -= RHS.SystemTime;
64 MemUsed -= RHS.MemUsed;
91 assert(RHS.TG == 0 &&
"Can only copy uninitialized timers");
94 assert(TG == 0 && T.TG == 0 &&
"Can only assign uninit timers");
104 const std::string &
getName()
const {
return Name; }
135 if (
T)
T->startTimer();
138 if (
T)
T->stopTimer();
164 std::vector<std::pair<TimeRecord, std::string> > TimersToPrint;
184 void removeTimer(
Timer &
T);
bool isInitialized() const
void print(const TimeRecord &Total, raw_ostream &OS) const
const std::string & getName() const
static TimeRecord getCurrentTime(bool Start=true)
NamedRegionTimer(StringRef Name, bool Enabled=true)
double getProcessTime() const
static cl::opt< bool > Enabled("stats", cl::desc("Enable statistics output from program (available with Asserts)"))
double getWallTime() const
void setName(StringRef name)
Timer(StringRef N, TimerGroup &tg)
double getUserTime() const
ssize_t getMemUsed() const
void print(raw_ostream &OS)
print - Print any started timers in this group and zero them.
double getSystemTime() const
#define LLVM_DELETED_FUNCTION
void operator+=(const TimeRecord &RHS)
const Timer & operator=(const Timer &T)
bool operator<(const TimeRecord &T) const
static void printAll(raw_ostream &OS)
printAll - This static method prints all timers and clears them all out.
void operator-=(const TimeRecord &RHS)