Measure of system resources.
More...
#include <Timer.h>
|
| Timer (void) |
| Default constructor.
|
|
void | start (void) |
| Sets the accounting variables to mark the start of accounting period using the unix functions times() and getrusage . More...
|
|
void | pause (void) |
| Sets the accounting variables to mark the end of accounting period using the unix functions times() and getrusage . More...
|
|
double | getReal (void) const |
| Uses the difference between the starting and ending accounting variables to determine the elapsed real time between the last calls to start()} and {pause(). More...
|
|
double | getCPU (void) const |
| Uses the difference between the starting and ending accounting variables to determine the CPU time allocated the process between the last calls to start()} and {pause(). More...
|
|
int | getNumPageFaults (void) const |
| Uses the difference between the starting and ending accounting variables to determine the number of page faults that required reading of pages from disk between the last calls to start() and {pause()}. More...
|
|
virtual void | Print (std::ostream &s) const |
| Uses the difference between the starting and ending accounting variables to determine the real time, CPU time, operating system time allocate the process, total number of page faults, number of page faults that required reading of pages from memory, and number of page faults that required no reading from disk between the last calls to start()} and {pause(). More...
|
|
|
std::ostream & | operator<< (std::ostream &, const Timer &) |
|
Measure of system resources.
A Timer object is an object which can be used to measure system resources, i.e. cpu time and memory usage.
◆ getCPU()
double XC::Timer::getCPU |
( |
void |
| ) |
const |
Uses the difference between the starting and ending accounting variables to determine the CPU time allocated the process between the last calls to start()} and {pause().
Returns this value in units of seconds.
◆ getNumPageFaults()
int XC::Timer::getNumPageFaults |
( |
void |
| ) |
const |
Uses the difference between the starting and ending accounting variables to determine the number of page faults that required reading of pages from disk between the last calls to start() and {pause()}.
Returns this value.
◆ getReal()
double XC::Timer::getReal |
( |
void |
| ) |
const |
Uses the difference between the starting and ending accounting variables to determine the elapsed real time between the last calls to start()} and {pause().
Returns this value in units of seconds.
◆ pause()
void XC::Timer::pause |
( |
void |
| ) |
|
Sets the accounting variables to mark the end of accounting period using the unix functions times() and getrusage
.
◆ Print()
void XC::Timer::Print |
( |
std::ostream & |
s | ) |
const |
|
virtual |
Uses the difference between the starting and ending accounting variables to determine the real time, CPU time, operating system time allocate the process, total number of page faults, number of page faults that required reading of pages from memory, and number of page faults that required no reading from disk between the last calls to start()} and {pause().
Send these values to s
.
◆ start()
void XC::Timer::start |
( |
void |
| ) |
|
Sets the accounting variables to mark the start of accounting period using the unix functions times() and getrusage
.
The documentation for this class was generated from the following files:
- src/utility/Timer.h
- src/utility/Timer.cpp