| 1083 | } |
| 1084 | |
| 1085 | double printTime_strftime() { |
| 1086 | int count = 1000000; |
| 1087 | char buffer[1000]; |
| 1088 | |
| 1089 | std::time_t result = std::time(nullptr); |
| 1090 | std:tm *tm = localtime(&result); |
| 1091 | |
| 1092 | uint64_t start = Cycles::rdtsc(); |
| 1093 | for (int i = 0; i < count; i++) { |
| 1094 | strftime(buffer, 1000, "%y/%m/%d %H:%M:%S", tm); |
| 1095 | } |
| 1096 | uint64_t stop = Cycles::rdtsc(); |
| 1097 | discard(&buffer); |
| 1098 | |
| 1099 | return Cycles::toSeconds(stop - start)/count; |
| 1100 | } |
| 1101 | |
| 1102 | double printTime_strftime_wConversion() { |
| 1103 | int count = 1000000; |