|
Public Member Functions |
| | Resources (bool max=false) |
|
void | start () |
| void | record () |
| void | stop () |
| void | resume (bool countBreakResources=false) |
| const timeval | userTime () const |
| const timeval | systemTime () const |
| const timeval | totalTime () const |
| const timeval | realTime () const |
|
long | memory () const |
|
long | text () const |
|
long | data () const |
|
long | stack () const |
|
long | minorPageFaults () const |
|
long | majorPageFaults () const |
|
long | swaps () const |
|
long | inputBlocks () const |
|
long | outputBlocks () const |
|
long | messagesSent () const |
|
long | messagesReceived () const |
|
long | signalsReceived () const |
|
long | voluntaryContextSwitches () const |
|
long | involuntaryContextSwitches () const |
| wostream & | print (wostream &wos) const |
Static Public Member Functions |
|
void | add (const timeval &time1, const timeval &time2, timeval &result) |
| | Add two timeval structures.
|
|
void | substract (const timeval &final, const timeval &initial, timeval &result) |
| | Substract two timeval structures.
|
|
int | compare (const timeval &t1, const timeval &t2) |
| | Compare two timeval structures. t1<t2:-1, t1==t2:0, t1>t2:1.
|
Protected Types |
| enum | state_t { Started,
Stopped
} |
| | The type of state this object might be in.
|
Protected Member Functions |
|
void | read (timeval &timeStamp, rusage &resourceUsage, bool initialReading) |
| | Get the time and resource usage from the operating system.
|
Static Protected Member Functions |
|
void | move (timeval &initial, timeval &final, timeval &newFinal) |
| | Translate [initial-final] to [newInitial-newFinal].
|
|
wostream & | printTime (wostream &wos, const timeval &tv) |
Friends |
|
CSP_API wostream & | operator<< (wostream &wos, const Resources &resources) |
+->>>-+ +->>>-+ | | | | | | | | | | | | start()--<<<--->>>--record()----->>>-----stop() | | | | | | | ^ | | | | ^ | | | | ^ | | | | | | | | +-----<<<-----resume()--<<<--->>>--+ | | | +-----------<<<------------------>>>----------+
FIXME: The code works per process, not per thread. FIXME: Many attributes are not implemented for Windows. Even Linux doesn't seem to support all of them.