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

Function snprintfFileLocation

runtime/Perf.cc:964–980  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

962}
963
964double snprintfFileLocation()
965{
966 int count = 1000000;
967 char buffer[1000];
968
969 uint64_t start = Cycles::rdtsc();
970 Util::serialize();
971 for (int i = 0; i < count; ++i) {
972 snprintf(buffer, 1000,
973 "%s:%d:%s",
974 __FILE__, __LINE__, __func__);
975 }
976 Util::serialize();
977 uint64_t stop = Cycles::rdtsc();
978
979 return Cycles::toSeconds(stop - start)/count;
980}
981
982double snprintfTime()
983{

Callers

nothing calls this directly

Calls 2

rdtscFunction · 0.85
serializeFunction · 0.70

Tested by

no test coverage detected