LLVM 20.0.0git
|
This class is used to track the amount of time spent between invocations of its startTimer()/stopTimer() methods. More...
#include "llvm/Support/Timer.h"
Public Member Functions | |
Timer (StringRef TimerName, StringRef TimerDescription) | |
Timer (StringRef TimerName, StringRef TimerDescription, TimerGroup &tg) | |
Timer (const Timer &RHS) | |
const Timer & | operator= (const Timer &T) |
~Timer () | |
Timer ()=default | |
Create an uninitialized timer, client must use 'init'. | |
void | init (StringRef TimerName, StringRef TimerDescription) |
void | init (StringRef TimerName, StringRef TimerDescription, TimerGroup &tg) |
const std::string & | getName () const |
const std::string & | getDescription () const |
bool | isInitialized () const |
bool | isRunning () const |
Check if the timer is currently running. | |
bool | hasTriggered () const |
Check if startTimer() has ever been called on this timer. | |
void | startTimer () |
Start the timer running. | |
void | stopTimer () |
Stop the timer. | |
void | clear () |
Clear the timer state. | |
TimeRecord | getTotalTime () const |
Return the duration for which this timer has been running. | |
Friends | |
class | TimerGroup |
This class is used to track the amount of time spent between invocations of its startTimer()/stopTimer() methods.
Given appropriate OS support it can also keep track of the RSS of the program at various points. By default, the Timer will print the amount of time it has captured to standard error when the last timer is destroyed, otherwise it is printed when its TimerGroup is destroyed. Timers do not print their information if they are never started.
|
inline |
|
explicitdefault |
Create an uninitialized timer, client must use 'init'.
void Timer::clear | ( | ) |
Clear the timer state.
Definition at line 205 of file Timer.cpp.
Referenced by llvm::RecordKeeper::startTimer(), and llvm::DebuginfodCollection::update().
|
inline |
|
inline |
Definition at line 111 of file Timer.h.
Referenced by startTimer(), and stopTimer().
|
inline |
|
inline |
Check if startTimer() has ever been called on this timer.
void Timer::init | ( | StringRef | TimerName, |
StringRef | TimerDescription, | ||
TimerGroup & | tg | ||
) |
Definition at line 136 of file Timer.cpp.
References assert(), llvm::StringRef::begin(), and llvm::StringRef::end().
|
inline |
Check if the timer is currently running.
Definition at line 116 of file Timer.h.
Referenced by llvm::RecordKeeper::startTimer(), and llvm::DebuginfodCollection::update().
void Timer::startTimer | ( | ) |
Start the timer running.
Time between calls to startTimer/stopTimer is counted by the Timer class. Note that these calls must be correctly paired.
Definition at line 190 of file Timer.cpp.
References assert(), llvm::TimeRecord::getCurrentTime(), getName(), and Signposts.
Referenced by llvm::RecordKeeper::startTimer(), and llvm::DebuginfodCollection::update().
void Timer::stopTimer | ( | ) |
Stop the timer.
Definition at line 197 of file Timer.cpp.
References assert(), llvm::TimeRecord::getCurrentTime(), getName(), and Signposts.
Referenced by llvm::RecordKeeper::startTimer(), llvm::RecordKeeper::stopTimer(), and llvm::DebuginfodCollection::update().
|
friend |