Measure the cost of reading high precision time
| 1054 | |
| 1055 | // Measure the cost of reading high precision time |
| 1056 | double high_resolution_clockTest() { |
| 1057 | int count = 1000000; |
| 1058 | |
| 1059 | uint64_t start = Cycles::rdtsc(); |
| 1060 | for (int i = 0; i < count; i++) { |
| 1061 | std::chrono::high_resolution_clock::now(); |
| 1062 | } |
| 1063 | uint64_t stop = Cycles::rdtsc(); |
| 1064 | |
| 1065 | return Cycles::toSeconds(stop - start)/count; |
| 1066 | } |
| 1067 | |
| 1068 | // Measure the cost of printing via ctime |
| 1069 | double printTime_ctime() { |