Line | |
---|
1 | #ifndef BENCHMARK_TOOLS_H |
---|
2 | #define BENCHMARK_TOOLS_H |
---|
3 | |
---|
4 | #include<string> |
---|
5 | #include<iostream> |
---|
6 | #include<iomanip> |
---|
7 | #include<lemon/time_measure.h> |
---|
8 | |
---|
9 | extern std::string test_name; |
---|
10 | extern std::string instance_name; |
---|
11 | |
---|
12 | extern const std::string DATADIR_PATH; |
---|
13 | |
---|
14 | |
---|
15 | inline void logTime(const std::string &_instance_name, |
---|
16 | const std::string &subtest_name, |
---|
17 | const lemon::TimeStamp &time) |
---|
18 | { |
---|
19 | std::cout << "*** " << test_name |
---|
20 | << ' ' << _instance_name |
---|
21 | << ' ' << subtest_name |
---|
22 | << ' ' << std::setiosflags(std::ios::fixed) << std::setprecision(4) |
---|
23 | << time.realTime() << ' ' |
---|
24 | << time.realTime()/(time.userTime()+time.systemTime()) - 1.0 |
---|
25 | << std::endl; |
---|
26 | } |
---|
27 | |
---|
28 | inline void logTime(const std::string &subtest_name, |
---|
29 | const lemon::TimeStamp &time) |
---|
30 | { |
---|
31 | logTime(instance_name,subtest_name,time); |
---|
32 | } |
---|
33 | |
---|
34 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.