Timer and resource monitor. More...
#include <resourceMonitor.hh>
Public Member Functions | |
ResourceMonitor () | |
std::ostream & | sample (std::ostream &os) |
float | utime () |
Friends | |
std::ostream & | operator<< (std::ostream &os, ResourceMonitor &rm) |
Timer and resource monitor.
Definition at line 29 of file resourceMonitor.hh.
|
inline |
Default constructor. Initializes the timer and resource monitor, ie. fills ru_.
Definition at line 41 of file resourceMonitor.hh.
std::ostream & concepts::ResourceMonitor::sample | ( | std::ostream & | os | ) |
Returns an output stream with resource information. There are timing information since construction or last output and memory usage information of the process.
Example:
3.21s [utime = 6.36s, stime = 3.09s, minflt = 0, majflt = 0, maxrss = 0.00KB]
the numbers before the [] gives the user and system time since the last output. The time values in the [] are the cumulated user and system time since the process started.
minflt
gives the number of page faults not requiring physical I/O
maxflt
gives the number of page faults requiring physical I/O
maxrss
gives the memory needed by the process
float concepts::ResourceMonitor::utime | ( | ) |
Returns the user time since the last call of ResourceMonitor
using getrusage
. This is not very precise (1/100 sec).
|
friend |
Definition at line 30 of file resourceMonitor.hh.