iLab Neuromorphic Robotics Toolkit  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
nrt::CPUTimer Class Reference

#include <nrt/Core/Debugging/CPUTimer.H>

Utility class for monitoring user/system cpu usage plus wall-clock time.

Definition at line 47 of file CPUTimer.H.

Public Member Functions

 CPUTimer ()
 Constructor; immediately start timing.
 
void reset ()
 Reset the timer and immediately start timing again. More...
 
void mark ()
 Mark the current time for access via user_secs()/sys_secs()/real_secs() More...
 
double user_secs () const
 Get the number of seconds spent executing user instructions between reset() and mark()
 
double sys_secs () const
 
double real_secs () const
 Get the real (wall-clock) CPU seconds between reset() and mark()
 
void report (char const *where="") const
 Print a report based on the most recent mark() More...
 

Member Function Documentation

void nrt::CPUTimer::reset ( )

Reset the timer and immediately start timing again.

Use this function to start timing.

void nrt::CPUTimer::mark ( )

Mark the current time for access via user_secs()/sys_secs()/real_secs()

Use this function to stop timing.

double nrt::CPUTimer::sys_secs ( ) const

Get the number of seconds spent executing system code on behalf of this process between reset() and mark()

void nrt::CPUTimer::report ( char const *  where = "") const

Print a report based on the most recent mark()

Parameters
wherea message pre-pended before the output, typically indicating where the report comes from.

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