MCPcopy Create free account
hub / github.com/PlatformLab/NanoLog / printTime_strftime_wConversion

Function printTime_strftime_wConversion

runtime/Perf.cc:1102–1117  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1100}
1101
1102double printTime_strftime_wConversion() {
1103 int count = 1000000;
1104 char buffer[1000];
1105
1106 std::time_t result = std::time(nullptr);
1107
1108 uint64_t start = Cycles::rdtsc();
1109 for (int i = 0; i < count; i++) {
1110 std:tm *tm = localtime(&result);
1111 strftime(buffer, 1000, "%y/%m/%d %H:%M:%S", tm);
1112 }
1113 uint64_t stop = Cycles::rdtsc();
1114 discard(&buffer);
1115
1116 return Cycles::toSeconds(stop - start)/count;
1117}
1118
1119// Measure the cost of cpuid
1120double serialize() {

Callers

nothing calls this directly

Calls 2

rdtscFunction · 0.85
discardFunction · 0.70

Tested by

no test coverage detected