LLVM 22.0.0git
llvm::TimeRecord Class Reference

#include "llvm/Support/Timer.h"

Public Member Functions

 TimeRecord ()=default
double getProcessTime () const
double getUserTime () const
double getSystemTime () const
double getWallTime () const
ssize_t getMemUsed () const
uint64_t getInstructionsExecuted () const
bool operator< (const TimeRecord &T) const
void operator+= (const TimeRecord &RHS)
void operator-= (const TimeRecord &RHS)
LLVM_ABI void print (const TimeRecord &Total, raw_ostream &OS) const
 Print the current time record to OS, with a breakdown showing contributions to the Total time record.

Static Public Member Functions

static LLVM_ABI TimeRecord getCurrentTime (bool Start=true)
 Get the current time and memory usage.

Detailed Description

Definition at line 28 of file Timer.h.

Constructor & Destructor Documentation

◆ TimeRecord()

llvm::TimeRecord::TimeRecord ( )
default

Member Function Documentation

◆ getCurrentTime()

TimeRecord TimeRecord::getCurrentTime ( bool Start = true)
static

Get the current time and memory usage.

If Start is true we get the memory usage before the time, otherwise we get time before memory usage. This matters if the time to get the memory usage is significant and shouldn't be counted as part of a duration.

Definition at line 128 of file Timer.cpp.

References getCurInstructionsExecuted(), getMemUsage(), llvm::sys::Process::GetTimeUsage(), now(), and TimeRecord().

Referenced by llvm::Timer::startTimer(), and llvm::Timer::stopTimer().

◆ getInstructionsExecuted()

uint64_t llvm::TimeRecord::getInstructionsExecuted ( ) const
inline

Definition at line 48 of file Timer.h.

Referenced by print().

◆ getMemUsed()

ssize_t llvm::TimeRecord::getMemUsed ( ) const
inline

Definition at line 47 of file Timer.h.

Referenced by print().

◆ getProcessTime()

double llvm::TimeRecord::getProcessTime ( ) const
inline

Definition at line 43 of file Timer.h.

Referenced by print().

◆ getSystemTime()

double llvm::TimeRecord::getSystemTime ( ) const
inline

Definition at line 45 of file Timer.h.

Referenced by print().

◆ getUserTime()

double llvm::TimeRecord::getUserTime ( ) const
inline

Definition at line 44 of file Timer.h.

Referenced by print().

◆ getWallTime()

double llvm::TimeRecord::getWallTime ( ) const
inline

◆ operator+=()

void llvm::TimeRecord::operator+= ( const TimeRecord & RHS)
inline

Definition at line 55 of file Timer.h.

References RHS, and TimeRecord().

◆ operator-=()

void llvm::TimeRecord::operator-= ( const TimeRecord & RHS)
inline

Definition at line 62 of file Timer.h.

References RHS, and TimeRecord().

◆ operator<()

bool llvm::TimeRecord::operator< ( const TimeRecord & T) const
inline

Definition at line 50 of file Timer.h.

References T, and TimeRecord().

◆ print()

void TimeRecord::print ( const TimeRecord & Total,
raw_ostream & OS ) const

Print the current time record to OS, with a breakdown showing contributions to the Total time record.

Definition at line 186 of file Timer.cpp.

References llvm::format(), getInstructionsExecuted(), getMemUsed(), getProcessTime(), getSystemTime(), getUserTime(), getWallTime(), printVal(), TimeRecord(), and llvm::Total.


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