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

Function printTime_strftime

runtime/Perf.cc:1085–1100  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1083}
1084
1085double 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
1102double printTime_strftime_wConversion() {
1103 int count = 1000000;

Callers

nothing calls this directly

Calls 2

rdtscFunction · 0.85
discardFunction · 0.70

Tested by

no test coverage detected