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

Function perfCyclesToSeconds

runtime/Perf.cc:901–914  ·  view source on GitHub ↗

Measure the cost of the Cycles::toSeconds method.

Source from the content-addressed store, hash-verified

899
900// Measure the cost of the Cycles::toSeconds method.
901double perfCyclesToSeconds()
902{
903 int count = 1000000;
904 double total = 0;
905 uint64_t cycles = 994261;
906
907 uint64_t start = Cycles::rdtsc();
908 for (int i = 0; i < count; i++) {
909 total += Cycles::toSeconds(cycles);
910 }
911 uint64_t stop = Cycles::rdtsc();
912
913 return Cycles::toSeconds(stop - start)/count;
914}
915
916// Measure the cost of the reading the CPU timestamp counter
917double rdtsc_test()

Callers

nothing calls this directly

Calls 1

rdtscFunction · 0.85

Tested by

no test coverage detected