LLVM API Documentation

Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

llvm::Timer Class Reference

#include <Timer.h>

Collaboration diagram for llvm::Timer:

Collaboration graph
[legend]
List of all members.

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
long getMemUsed () const
long getPeakMem () const
std::string getName () const
const Timeroperator= (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

Detailed Description

Timer - This class is used to track the amount of time spent between invocations of it's 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 laster timer is destroyed, otherwise it is printed when it's TimerGroup is destroyed. Timer's do not print their information if they are never started.

Definition at line 35 of file Timer.h.


Constructor & Destructor Documentation

Timer::Timer const std::string &  N  ) 
 

Definition at line 64 of file Timer.cpp.

References llvm::TimerGroup::addTimer().

Timer::Timer const std::string &  N,
TimerGroup tg
 

Definition at line 70 of file Timer.cpp.

References llvm::TimerGroup::addTimer().

Timer::Timer const Timer T  ) 
 

Definition at line 76 of file Timer.cpp.

References llvm::TimerGroup::addTimer(), operator=(), and TG.

Timer::~Timer  ) 
 

Definition at line 91 of file Timer.cpp.

References llvm::TimerGroup::addTimerToPrint(), and llvm::TimerGroup::removeTimer().


Member Function Documentation

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

Definition at line 204 of file Timer.cpp.

References E, getMemUsage(), and I.

Referenced by llvm::DSGraph::cloneInto(), and llvm::DSGraph::DSGraph().

long llvm::Timer::getMemUsed  )  const [inline]
 

Definition at line 53 of file Timer.h.

std::string llvm::Timer::getName  )  const [inline]
 

Definition at line 55 of file Timer.h.

long llvm::Timer::getPeakMem  )  const [inline]
 

Definition at line 54 of file Timer.h.

double llvm::Timer::getProcessTime  )  const [inline]
 

Definition at line 51 of file Timer.h.

Referenced by print().

double llvm::Timer::getWallTime  )  const [inline]
 

Definition at line 52 of file Timer.h.

bool llvm::Timer::operator< const Timer T  )  const [inline]
 

Definition at line 71 of file Timer.h.

References Elapsed.

const Timer& llvm::Timer::operator= const Timer T  )  [inline]
 

Definition at line 57 of file Timer.h.

References Elapsed, MemUsed, Name, PeakMem, PeakMemBase, Started, SystemTime, TG, and UserTime.

Referenced by Timer().

bool llvm::Timer::operator> const Timer T  )  const [inline]
 

Definition at line 75 of file Timer.h.

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 265 of file Timer.cpp.

References Elapsed, getProcessTime(), MemUsed, PeakMem, printVal(), SystemTime, and UserTime.

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 164 of file Timer.cpp.

References TimeRecord::Elapsed, getTimeRecord(), TimeRecord::MemUsed, TimeRecord::SystemTime, and TimeRecord::UserTime.

Referenced by llvm::TimeRegion::TimeRegion().

void Timer::stopTimer  ) 
 

stopTimer - Stop the timer.

Definition at line 175 of file Timer.cpp.

References TimeRecord::Elapsed, getTimeRecord(), I, TimeRecord::MemUsed, TimeRecord::SystemTime, and TimeRecord::UserTime.

Referenced by llvm::TimeRegion::~TimeRegion().


Friends And Related Function Documentation

friend class TimerGroup [friend]
 

Definition at line 98 of file Timer.h.


The documentation for this class was generated from the following files: