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

Function cond_wait_for_microsecond

runtime/Perf.cc:1145–1158  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1143}
1144
1145double cond_wait_for_microsecond() {
1146 int count = 10000;
1147 std::mutex mutex;
1148 std::condition_variable cond;
1149 std::unique_lock<std::mutex> lock(mutex);
1150
1151 uint64_t start = Cycles::rdtsc();
1152 for (int i = 0; i < count; ++i) {
1153 cond.wait_for(lock, std::chrono::microseconds(1));
1154 }
1155 uint64_t stop = Cycles::rdtsc();
1156
1157 return Cycles::toSeconds(stop - start)/count;
1158}
1159
1160
1161double uncompressedLogEntryIteration() {

Callers

nothing calls this directly

Calls 1

rdtscFunction · 0.85

Tested by

no test coverage detected