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

Method MsSleep

phxqueue/comm/utils/time_util.cpp:42–51  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

40}
41
42void Time::MsSleep(const int time_ms) {
43 timespec t;
44 t.tv_sec = time_ms / 1000;
45 t.tv_nsec = (time_ms % 1000) * 1000000;
46
47 int ret = 0;
48 do {
49 ret = ::nanosleep(&t, &t);
50 } while (ret == -1 && errno == EINTR);
51}
52
53class PoissonDistribution::PoissonDistributionImpl {
54public:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected