ZED Open Capture  v0.6.0
Low level camera driver for the ZED stereo camera family
Public Member Functions | List of all members
sl_oc::tools::StopWatch Class Reference

Stop Timer used to measure time intervals. More...

#include <stopwatch.hpp>

Public Member Functions

 StopWatch ()
 StopWatch constructor. Automatically starts time measurement. More...
 
virtual ~StopWatch ()
 
void tic ()
 Set the beginning time of the time measurement. More...
 
double toc ()
 Calculates the seconds elapsed from the last tic. More...
 

Detailed Description

Stop Timer used to measure time intervals.

Examples
zed_oc_depth_example.cpp, and zed_oc_tune_stereo_sgbm.cpp.

Definition at line 33 of file stopwatch.hpp.

Constructor & Destructor Documentation

◆ StopWatch()

sl_oc::tools::StopWatch::StopWatch ( )
inline

StopWatch constructor. Automatically starts time measurement.

Definition at line 40 of file stopwatch.hpp.

40 {tic();}
void tic()
Set the beginning time of the time measurement.
Definition: stopwatch.hpp:46

References tic().

◆ ~StopWatch()

virtual sl_oc::tools::StopWatch::~StopWatch ( )
inlinevirtual

Definition at line 41 of file stopwatch.hpp.

41 {};

Member Function Documentation

◆ tic()

void sl_oc::tools::StopWatch::tic ( )
inline

Set the beginning time of the time measurement.

Definition at line 46 of file stopwatch.hpp.

47  {
48  mStartTime = std::chrono::steady_clock::now(); // Set the start time point
49  }

Referenced by StopWatch().

◆ toc()

double sl_oc::tools::StopWatch::toc ( )
inline

Calculates the seconds elapsed from the last tic.

Returns
the seconds elapsed from the last tic with microseconds resolution.
Examples
zed_oc_depth_example.cpp, and zed_oc_tune_stereo_sgbm.cpp.

Definition at line 55 of file stopwatch.hpp.

56  {
57  auto now = std::chrono::steady_clock::now();
58  double elapsed_usec = std::chrono::duration_cast<std::chrono::microseconds>(now - mStartTime).count();
59  return elapsed_usec/1e6;
60  }

Referenced by applyStereoMatching(), and main().


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