MCPcopy Create free account
hub / github.com/catboost/catboost / NanoSleep

Function NanoSleep

util/system/datetime.cpp:81–95  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

79}
80
81void NanoSleep(ui64 ns) noexcept {
82#if defined(_win_)
83 Sleep(ns / 1000000);
84#else
85 const ui64 NS = 1000 * 1000 * 1000;
86 struct timespec req;
87 req.tv_sec = ns / NS;
88 req.tv_nsec = ns % NS;
89 struct timespec left;
90 while (nanosleep(&req, &left) < 0) {
91 Y_ASSERT(errno == EINTR);
92 req = left;
93 }
94#endif
95}
96
97#if defined(_x86_)
98namespace NPrivate {

Callers 4

mainFunction · 0.85
WaitMethod · 0.85
SleepFunction · 0.85
Y_UNIT_TESTFunction · 0.85

Calls 2

SleepFunction · 0.85
nanosleepFunction · 0.50

Tested by

no test coverage detected