CVD::cvd_timer Class Reference
[General C++ and system helper functions]

#include <timer.h>

List of all members.


Detailed Description

Provides the time elapsed in seconds.

This predominantly a wrapper for the system call gettimeofday(), but can also provides a convenient way of converting from other time units. In all cases, the time is given relative to the time the class was created, or the last time reset() was called.

Definition at line 41 of file timer.h.


Public Member Functions

 cvd_timer ()
double get_time ()
double conv_ntime (signed long long time)
double conv_ntime (const struct timeval &tv)
double conv_ntime (const double time) const
double reset ()

Constructor & Destructor Documentation

CVD::cvd_timer::cvd_timer (  ) 

Create a timer, and set the start time to be now.


Member Function Documentation

double CVD::cvd_timer::get_time (  ) 

How many seconds have elapsed since the start time?

Referenced by CVD::V4L1Buffer< T >::get_frame().

double CVD::cvd_timer::conv_ntime ( signed long long  time  ) 

Convert the current time from units of nanoseconds into a double, correcting for the start time.

Parameters:
time The current time in nanoseconds

double CVD::cvd_timer::conv_ntime ( const struct timeval &  tv  ) 

Convert the current time from a timeval into a double, correcting for the start time.

Parameters:
tv The current time as a timeval

double CVD::cvd_timer::conv_ntime ( const double  time  )  const [inline]

Convert current time given as double by correcting for the start time.

Parameters:
time current time as double

Definition at line 61 of file timer.h.

double CVD::cvd_timer::reset (  ) 

Sets the start time to the current time.


The documentation for this class was generated from the following file:
Generated on Wed Feb 18 10:23:08 2009 for CVD by  doxygen 1.5.3