cgv
stopwatch.h
1 #pragma once
2 
3 #include "lib_begin.h"
4 
5 namespace cgv {
6  namespace utils {
7 
36 class CGV_API stopwatch
37 {
38 public:
39  //standard constructor starts time measurement
40  stopwatch();
41  //start counting time
42  stopwatch(double *result);
43  // add_time adds the time ellapsed thus far
44  void add_time();
45  //destructor stops time measurement and puts the result into cout
46  ~stopwatch();
48  double get_elapsed_time() const;
50  double restart();
51 private:
52  void init();
53  double get_current_time(long long& end) const;
54  long long start;
55  double *resultd;
56 };
57 
58  }
59 }
60 
61 #include <cgv/config/lib_end.h>
cgv::utils::stopwatch
Definition: stopwatch.h:37
cgv
the cgv namespace
Definition: vr_calib.cxx:9