cgv
Loading...
Searching...
No Matches
stopwatch.h
1#pragma once
2
3#include "lib_begin.h"
4
5namespace cgv {
6 namespace utils {
7
33
34class CGV_API stopwatch
35{
36public:
37 //standard constructor starts time measurement; if silent is true the stopwatch does not print time upon destruction
38 stopwatch(bool silent = false);
39 //start counting time
40 stopwatch(double *result, bool silent = false);
41 // add_time adds the time ellapsed thus far
42 void add_time();
43 //destructor stops time measurement and puts the result into cout
44 ~stopwatch();
46 double get_elapsed_time() const;
48 double restart();
49private:
50 void init();
51 double get_current_time(long long& end) const;
52 long long start;
53 double *resultd;
54 bool silent;
55};
56
57 }
58}
59
60#include <cgv/config/lib_end.h>
double get_elapsed_time() const
return time elpased thus far
Definition stopwatch.cxx:68
double restart()
restart timer and return time elapsed until restart
Definition stopwatch.cxx:75
namespace that holds tools that dont fit any other namespace
this header is dependency free
Definition print.h:11