MCPcopy Create free account
hub / github.com/Tencent/phxqueue / MsSleep

Method MsSleep

phxqueue/comm/utils/time_util.cpp:172–183  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

170}
171
172void PoissonDistribution :: MsSleep(const int time_ms)
173{
174 timespec t;
175 t.tv_sec = time_ms / 1000;
176 t.tv_nsec = (time_ms % 1000) * 1000000;
177
178 int ret = 0;
179 do
180 {
181 ret = ::nanosleep(&t, &t);
182 } while (ret == -1 && errno == EINTR);
183}
184
185} // namespace utils
186

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected