class Timer
Declaration
class Timer { /* full declaration omitted */ };
Description
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.
Declared at: llvm/include/llvm/Support/Timer.h:76
Method Overview
- public Timer(llvm::StringRef TimerName, llvm::StringRef TimerDescription)
- public Timer(llvm::StringRef TimerName, llvm::StringRef TimerDescription, llvm::TimerGroup & tg)
- public Timer(const llvm::Timer & RHS)
- public Timer()
- public void clear()
- public const std::string & getDescription() const
- public const std::string & getName() const
- public llvm::TimeRecord getTotalTime() const
- public bool hasTriggered() const
- public void init(llvm::StringRef TimerName, llvm::StringRef TimerDescription)
- public void init(llvm::StringRef TimerName, llvm::StringRef TimerDescription, llvm::TimerGroup & tg)
- public bool isInitialized() const
- public bool isRunning() const
- public void startTimer()
- public void stopTimer()
- public ~Timer()
Methods
¶Timer(llvm::StringRef TimerName,
llvm::StringRef TimerDescription)
Timer(llvm::StringRef TimerName,
llvm::StringRef TimerDescription)
Declared at: llvm/include/llvm/Support/Timer.h:88
Parameters
- llvm::StringRef TimerName
- llvm::StringRef TimerDescription
¶Timer(llvm::StringRef TimerName,
llvm::StringRef TimerDescription,
llvm::TimerGroup& tg)
Timer(llvm::StringRef TimerName,
llvm::StringRef TimerDescription,
llvm::TimerGroup& tg)
Declared at: llvm/include/llvm/Support/Timer.h:91
Parameters
- llvm::StringRef TimerName
- llvm::StringRef TimerDescription
- llvm::TimerGroup& tg
¶Timer(const llvm::Timer& RHS)
Timer(const llvm::Timer& RHS)
Declared at: llvm/include/llvm/Support/Timer.h:94
Parameters
- const llvm::Timer& RHS
¶Timer()
Timer()
Description
Create an uninitialized timer, client must use 'init'.
Declared at: llvm/include/llvm/Support/Timer.h:104
¶void clear()
void clear()
Description
Clear the timer state.
Declared at: llvm/include/llvm/Support/Timer.h:127
¶const std::string& getDescription() const
const std::string& getDescription() const
Declared at: llvm/include/llvm/Support/Timer.h:109
¶const std::string& getName() const
const std::string& getName() const
Declared at: llvm/include/llvm/Support/Timer.h:108
¶llvm::TimeRecord getTotalTime() const
llvm::TimeRecord getTotalTime() const
Description
Return the duration for which this timer has been running.
Declared at: llvm/include/llvm/Support/Timer.h:130
¶bool hasTriggered() const
bool hasTriggered() const
Description
Check if startTimer() has ever been called on this timer.
Declared at: llvm/include/llvm/Support/Timer.h:116
¶void init(llvm::StringRef TimerName,
llvm::StringRef TimerDescription)
void init(llvm::StringRef TimerName,
llvm::StringRef TimerDescription)
Declared at: llvm/include/llvm/Support/Timer.h:105
Parameters
- llvm::StringRef TimerName
- llvm::StringRef TimerDescription
¶void init(llvm::StringRef TimerName,
llvm::StringRef TimerDescription,
llvm::TimerGroup& tg)
void init(llvm::StringRef TimerName,
llvm::StringRef TimerDescription,
llvm::TimerGroup& tg)
Declared at: llvm/include/llvm/Support/Timer.h:106
Parameters
- llvm::StringRef TimerName
- llvm::StringRef TimerDescription
- llvm::TimerGroup& tg
¶bool isInitialized() const
bool isInitialized() const
Declared at: llvm/include/llvm/Support/Timer.h:110
¶bool isRunning() const
bool isRunning() const
Description
Check if the timer is currently running.
Declared at: llvm/include/llvm/Support/Timer.h:113
¶void startTimer()
void startTimer()
Description
Start the timer running. Time between calls to startTimer/stopTimer is counted by the Timer class. Note that these calls must be correctly paired.
Declared at: llvm/include/llvm/Support/Timer.h:121
¶void stopTimer()
void stopTimer()
Description
Stop the timer.
Declared at: llvm/include/llvm/Support/Timer.h:124
¶~Timer()
~Timer()
Declared at: llvm/include/llvm/Support/Timer.h:101