aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJinweiClarkChao <[email protected]>2015-08-25 16:03:05 +0800
committerJinweiClarkChao <[email protected]>2015-08-25 16:49:50 +0800
commit66efed8b335610f9eae59fd3f52eccaffd7a6e0b (patch)
treea65d3ad57aa75d072b5f543fd5ea5c0a18a5c1ab /DCP/utility.h
parentf07885c1eb4c98dc52704517623b2e7df1ed616d (diff)
downloadDehaze-66efed8b335610f9eae59fd3f52eccaffd7a6e0b.tar.gz
fix
Diffstat (limited to 'DCP/utility.h')
-rw-r--r--DCP/utility.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/DCP/utility.h b/DCP/utility.h
new file mode 100644
index 0000000..55cc100
--- /dev/null
+++ b/DCP/utility.h
@@ -0,0 +1,29 @@
1#ifndef UTILITY_H
2#define UTILITY_H
3
4#include <iostream>
5#include <chrono>
6
7class TicToc
8{
9private:
10 typedef std::chrono::high_resolution_clock clock;
11 typedef std::chrono::microseconds res;
12 clock::time_point t1, t2;
13
14public:
15 void tic()
16 {
17 t1 = clock::now();
18 }
19
20 void toc()
21 {
22 t2 = clock::now();
23 std::cout << "Elapsed time: "
24 << std::chrono::duration_cast<res>(t2 - t1).count() / 1e6
25 << " seconds." << std::endl;
26 }
27};
28
29#endif \ No newline at end of file
Powered by cgit v1.2.3 (git 2.41.0)