RTAB-Map 0.23.10
Real-Time Appearance-Based Mapping
Loading...
Searching...
No Matches
UTimer Class Reference

#include <UTimer.h>

Public Member Functions

void start ()
 
void stop ()
 
double elapsed ()
 
double getElapsedTime ()
 
double restart ()
 
double ticks ()
 

Static Public Member Functions

static double now ()
 

Detailed Description

This class is used to time some codes (in seconds). On Unix, the resolution is up to microseconds (see gettimeofday()). On Windows, the performance counter is used (see QueryPerformanceCounter() and QueryPerformanceFrequency()). Example:

UTimer timer;
timer.start();
... (do some work)
timer.stop();
double seconds = timer.getInterval();
...
void start()
void stop()

Definition at line 46 of file UTimer.h.

Member Function Documentation

◆ now()

static double UTimer::now ( )
static

This method is used to get the time of the system right now.

Returns
double the time in seconds.

◆ start()

void UTimer::start ( )

This method starts the timer.

◆ stop()

void UTimer::stop ( )

This method stops the timer.

◆ elapsed()

double UTimer::elapsed ( )
inline

This method is used to get the elapsed time between now and the start(). If timer is stopped, the interval time between stop() and the start() is returned.

Returns
double the interval in seconds.

Definition at line 75 of file UTimer.h.

◆ restart()

double UTimer::restart ( )
inline

This method is used to get the interval of the timer while it is running. It's automatically stop the timer, get the interval and restart the timer. It's the same of calling stop(), elapsed() and start(). Method restart() does the same thing, for convenience.

Returns
double the interval in seconds.

Definition at line 86 of file UTimer.h.


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