]> rtime.felk.cvut.cz Git - hubacji1/iamcar2.git/blob - src/test-template.cc
Add time measurement functions
[hubacji1/iamcar2.git] / src / test-template.cc
1 #include <chrono>
2
3 std::chrono::high_resolution_clock::time_point TSTART_;
4 std::chrono::high_resolution_clock::time_point TEND_;
5 inline void TSTART() { TSTART_ = std::chrono::high_resolution_clock::now(); }
6 inline void TEND() { TEND_ = std::chrono::high_resolution_clock::now(); }
7 inline void TPRINT(const char *what)
8 {
9         std::chrono::duration<double> DT_;
10         DT_ = std::chrono::duration_cast<std::chrono::duration<double>>(
11                 TEND_ - TSTART_
12         );
13         std::cerr << what << ": " << DT_.count() << std::endl;
14 }
15
16 int main()
17 {
18         return 0;
19 }