Diffpack Documentation


Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Search  

CPUclock Class Reference

measures the CPU time in C++ programs. More...

#include <CPUclock.h>

List of all members.

Public Methods

 CPUclock ()
double getInterval ()
double getIntervalU ()
void initTime ()
double getTime ()
void lock ()
void unlock ()
bool locked () const


Detailed Description

measures the CPU time in C++ programs.

NAME: CPUclock - measures the CPU time in C++ programs

DESCRIPTION:

One can get the user time in absolute seconds, or the length of intervals can be measured (in seconds).


Constructor & Destructor Documentation

CPUclock::CPUclock ( )
 

The class has only one constructor which takes no arguments.


Member Function Documentation

double CPUclock::getInterval ( )
 

returns the length of the user+system time interval (in seconds) between the present call to getInterval and the last call to "initTime" or to "getInterval".

double CPUclock::getIntervalU ( )
 

as "getInterval", but only the user time is returned.

double CPUclock::getTime ( )
 

returns absolute user time in seconds

void CPUclock::initTime ( ) [inline]
 

start measuring the length of an interval (typically called prior to the computational job to be measured). In fact, "initTime" is just a call to "getInterval" - the purpose of the function is to make programs easier to read.

void CPUclock::lock ( ) [inline]
 

locks the time, that is, when this function is called, calls to "getInterval" will not reset the time each time the function is called.

bool CPUclock::locked ( ) const [inline]
 

returns true if timecounter is locked, and false otherwise.

void CPUclock::unlock ( ) [inline]
 

unlocks the time, that is, when this function is called, calls to "getInterval" will reset the time each time the function is called (default behaviour).


The documentation for this class was generated from the following file:
Copyright © 2003 inuTech GmbH. All rights reserved.