CVD 0.8
Public Member Functions
CVD::cvd_timer Class Reference

Provides the time elapsed in seconds. More...

#include <timer.h>

List of all members.

Public Member Functions

 cvd_timer ()
 cvd_timer (double start)
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 ()
void reset (const double t)
void reset_ns (long long t)

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 44 of file timer.h.


Member Function Documentation

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:
timeThe 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:
tvThe 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:
timecurrent time as double

Definition at line 68 of file timer.h.

void CVD::cvd_timer::reset ( const double  t)

Sets the start time to a specified time.

Parameters:
tzero relative to the Epoch.
void CVD::cvd_timer::reset_ns ( long long  t)

Sets the start time to a specified time.

Parameters:
tzero relative to the Epoch.

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