Classes | Namespaces | Defines | Functions
time.h File Reference
#include <cmath>
#include <string>
#include <boost/date_time/posix_time/posix_time.hpp>
Include dependency graph for common/time.h:

Go to the source code of this file.

Classes

class  pcl::ScopeTime
 Class to measure the time spent in a scope. More...
class  pcl::StopWatch
 Simple stopwatch. More...

Namespaces

namespace  pcl

Defines

#define DO_EVERY(secs, code)   DO_EVERY_TS(secs, pcl::getTime(), code)
 Executes code, only if secs are gone since last exec.
#define DO_EVERY_TS(secs, currentTime, code)
 Executes code, only if secs are gone since last exec.
#define MEASURE_FUNCTION_TIME   ScopeTime scopeTime(__func__)

Functions

double pcl::getTime ()

Detailed Description

Define methods for measuring time spent in code blocks

Definition in file common/time.h.


Define Documentation

#define DO_EVERY (   secs,
  code 
)    DO_EVERY_TS(secs, pcl::getTime(), code)

Executes code, only if secs are gone since last exec.

Definition at line 167 of file common/time.h.

#define DO_EVERY_TS (   secs,
  currentTime,
  code 
)
Value:
if (1) {\
  static double s_lastDone_ = 0.0; \
  double s_now_ = (currentTime); \
  if (s_lastDone_ > s_now_) \
    s_lastDone_ = s_now_; \
  if ((s_now_ - s_lastDone_) > (secs)) {        \
    code; \
    s_lastDone_ = s_now_; \
  }\
} else \
  (void)0

Executes code, only if secs are gone since last exec.

Definition at line 151 of file common/time.h.

#define MEASURE_FUNCTION_TIME   ScopeTime scopeTime(__func__)

Definition at line 137 of file common/time.h.



pcl
Author(s): Open Perception
autogenerated on Mon Oct 6 2014 03:19:14