MCPcopy Create free account
hub / github.com/apple/foundationdb / timer

Function timer

fdbmonitor/fdbmonitor.cpp:243–255  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

241}
242
243double timer() {
244#if defined(__linux__) || defined(__FreeBSD__)
245 struct timespec ts;
246 clock_gettime(CLOCK_MONOTONIC, &ts);
247 return double(ts.tv_sec) + (ts.tv_nsec * 1e-9);
248#elif defined(__APPLE__)
249 mach_timebase_info_data_t timebase_info;
250 mach_timebase_info(&timebase_info);
251 return ((mach_absolute_time() * timebase_info.numer) / timebase_info.denom) * 1e-9;
252#else
253#error Port me!
254#endif
255};
256
257int randomInt(int min, int max) {
258 static std::random_device rd;

Callers 15

start_processFunction · 0.70
load_confFunction · 0.70
mainFunction · 0.70
detectConflictsMethod · 0.50
skipListTestFunction · 0.50
checkAllPageChecksumsMethod · 0.50
openMethod · 0.50
SimpleCounterMethod · 0.50

Calls

no outgoing calls

Tested by 15

test_get_singleMethod · 0.40
test_get_many_sequentialFunction · 0.40
runUnitTestsMethod · 0.40
Future<Void> testKVReadFunction · 0.40
memoryTest2Function · 0.40
memoryTestFunction · 0.40
fastAllocTestFunction · 0.40
threadSafetyTestFunction · 0.40
threadSafetyTest2Function · 0.40