MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / SleepSeconds

Function SleepSeconds

tensorflow/tools/benchmark/benchmark_model.cc:232–245  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

230}
231
232void SleepSeconds(double sleep_seconds) {
233 if (sleep_seconds <= 0.0) {
234 return;
235 }
236#ifdef PLATFORM_WINDOWS
237 Sleep(sleep_seconds * 1000);
238#else
239 // Convert the inference_delay string into a timespec.
240 timespec req;
241 req.tv_sec = static_cast<time_t>(sleep_seconds);
242 req.tv_nsec = (sleep_seconds - req.tv_sec) * 1000000000;
243 nanosleep(&req, nullptr);
244#endif
245}
246
247} // namespace
248

Callers 2

TimeMultipleRunsFunction · 0.85
MainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected