|
LLVM
10.0.0
|
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 () | |
| Create an uninitialized timer, client must use 'init'. More... | |
| 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. More... | |
| bool | hasTriggered () const |
| Check if startTimer() has ever been called on this timer. More... | |
| void | startTimer () |
| Start the timer running. More... | |
| void | stopTimer () |
| Stop the timer. More... | |
| void | clear () |
| Clear the timer state. More... | |
| TimeRecord | getTotalTime () const |
| Return the duration for which this timer has been running. More... | |
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.
Definition at line 88 of file Timer.h.
References llvm::cl::init().
|
inline |
Definition at line 91 of file Timer.h.
References llvm::cl::init().
|
inlineexplicit |
Create an uninitialized timer, client must use 'init'.
Definition at line 104 of file Timer.h.
References llvm::cl::init().
| void Timer::clear | ( | ) |
Clear the timer state.
Definition at line 153 of file Timer.cpp.
Referenced by llvm::TimerGroup::clear(), and llvm::TimerGroup::~TimerGroup().
|
inline |
|
inline |
|
inline |
|
inline |
Check if startTimer() has ever been called on this timer.
Definition at line 116 of file Timer.h.
References clear().
Referenced by llvm::TimePassesHandler::print(), and llvm::TimerGroup::~TimerGroup().
Definition at line 94 of file Timer.cpp.
References getDefaultTimerGroup(), and llvm::cl::init().
Referenced by llvm::TimeRecord::print().
| void Timer::init | ( | StringRef | TimerName, |
| StringRef | TimerDescription, | ||
| TimerGroup & | tg | ||
| ) |
Definition at line 98 of file Timer.cpp.
References assert(), llvm::StringRef::begin(), llvm::StringRef::end(), and Name.
|
inline |
Definition at line 110 of file Timer.h.
Referenced by llvm::TimeRecord::print().
|
inline |
Check if the timer is currently running.
Definition at line 113 of file Timer.h.
Referenced by llvm::TimePassesHandler::print(), and llvm::TimerGroup::~TimerGroup().
| 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 138 of file Timer.cpp.
References assert(), llvm::TimeRecord::getCurrentTime(), and llvm::SignpostEmitter::startTimerInterval().
Referenced by llvm::TimePassesHandler::print(), llvm::TimeRegion::TimeRegion(), and llvm::TimerGroup::~TimerGroup().
| void Timer::stopTimer | ( | ) |
Stop the timer.
Definition at line 145 of file Timer.cpp.
References assert(), llvm::SignpostEmitter::endTimerInterval(), and llvm::TimeRecord::getCurrentTime().
Referenced by llvm::TimeRegion::~TimeRegion(), and llvm::TimerGroup::~TimerGroup().
|
friend |
1.8.13