| 230 | } |
| 231 | |
| 232 | void 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 |
no outgoing calls
no test coverage detected