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 time.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.


Detailed Description

Define methods for measuring time spent in code blocks.

Definition in file time.h.

Classes

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

Namespaces

namespace  pcl

Defines

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

Functions

double pcl::getTime ()

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 108 of file 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 92 of file time.h.

#define MEASURE_FUNCTION_TIME   ScopeTime scopeTime(__func__)

Definition at line 79 of file time.h.