LLVM API Documentation
#include <Timer.h>
Public Member Functions | |
| Timer (const std::string &N) | |
| Timer (const std::string &N, TimerGroup &tg) | |
| Timer (const Timer &T) | |
| ~Timer () | |
| double | getProcessTime () const |
| double | getWallTime () const |
| ssize_t | getMemUsed () const |
| size_t | getPeakMem () const |
| std::string | getName () const |
| const Timer & | operator= (const Timer &T) |
| bool | operator< (const Timer &T) const |
| bool | operator> (const Timer &T) const |
| void | startTimer () |
| void | stopTimer () |
| void | print (const Timer &Total, std::ostream &OS) |
Static Public Member Functions | |
| static void | addPeakMemoryMeasurement () |
Friends | |
| class | TimerGroup |
Definition at line 37 of file Timer.h.
| Timer::Timer | ( | const std::string & | N | ) | [explicit] |
| Timer::Timer | ( | const std::string & | N, | |
| TimerGroup & | tg | |||
| ) |
| Timer::Timer | ( | const Timer & | T | ) |
Definition at line 85 of file Timer.cpp.
References llvm::TimerGroup::addTimer(), operator=(), and TG.
| Timer::~Timer | ( | ) |
Definition at line 100 of file Timer.cpp.
References llvm::TimerGroup::addTimerToPrint(), and llvm::TimerGroup::removeTimer().
| double llvm::Timer::getProcessTime | ( | ) | const [inline] |
Definition at line 60 of file Timer.h.
References llvm::sys::SmartMutex< mt_only >::acquire(), Elapsed, Lock, MemUsed, Name, PeakMem, PeakMemBase, llvm::sys::SmartMutex< mt_only >::release(), Started, SystemTime, TG, and UserTime.
Referenced by Timer().
| void Timer::startTimer | ( | ) |
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 147 of file Timer.cpp.
References TimeRecord::Elapsed, getTimeRecord(), L, TimeRecord::MemUsed, TimeRecord::SystemTime, and TimeRecord::UserTime.
Referenced by llvm::DwarfException::BeginFunction(), llvm::DwarfDebug::BeginFunction(), llvm::DwarfDebug::BeginModule(), llvm::DwarfException::EndFunction(), llvm::DwarfDebug::EndFunction(), llvm::DwarfException::EndModule(), llvm::DwarfDebug::EndModule(), llvm::DwarfDebug::getOrCreateSourceID(), llvm::DwarfDebug::RecordInlinedFnEnd(), llvm::DwarfDebug::RecordInlinedFnStart(), llvm::DwarfDebug::RecordRegionEnd(), llvm::DwarfDebug::RecordRegionStart(), llvm::DwarfDebug::RecordSourceLine(), llvm::DwarfDebug::RecordVariable(), llvm::DwarfDebug::RecordVariableScope(), and llvm::TimeRegion::TimeRegion().
| void Timer::stopTimer | ( | ) |
stopTimer - Stop the timer.
Definition at line 159 of file Timer.cpp.
References TimeRecord::Elapsed, getTimeRecord(), L, TimeRecord::MemUsed, TimeRecord::SystemTime, and TimeRecord::UserTime.
Referenced by llvm::DwarfException::BeginFunction(), llvm::DwarfDebug::BeginFunction(), llvm::DwarfDebug::BeginModule(), llvm::DwarfException::EndFunction(), llvm::DwarfDebug::EndFunction(), llvm::DwarfException::EndModule(), llvm::DwarfDebug::EndModule(), llvm::DwarfDebug::getOrCreateSourceID(), llvm::DwarfDebug::RecordInlinedFnEnd(), llvm::DwarfDebug::RecordInlinedFnStart(), llvm::DwarfDebug::RecordRegionEnd(), llvm::DwarfDebug::RecordRegionStart(), llvm::DwarfDebug::RecordSourceLine(), llvm::DwarfDebug::RecordVariable(), llvm::DwarfDebug::RecordVariableScope(), and llvm::TimeRegion::~TimeRegion().
| void Timer::addPeakMemoryMeasurement | ( | ) | [static] |
addPeakMemoryMeasurement - This method should be called whenever memory usage needs to be checked. It adds a peak memory measurement to the currently active timers, which will be printed when the timer group prints
addPeakMemoryMeasurement - This method should be called whenever memory usage needs to be checked. It adds a peak memory measurement to the currently active timers, which will be printed when the timer group prints
Definition at line 205 of file Timer.cpp.
References E, and getMemUsage().
| void Timer::print | ( | const Timer & | Total, | |
| std::ostream & | OS | |||
| ) |
print - Print the current timer to standard error, and reset the "Started" flag.
Definition at line 303 of file Timer.cpp.
References llvm::sys::SmartMutex< mt_only >::acquire(), Elapsed, getProcessTime(), Lock, MemUsed, PeakMem, printVal(), llvm::sys::SmartMutex< mt_only >::release(), SystemTime, and UserTime.
friend class TimerGroup [friend] |