| 22 | namespace util { |
| 23 | |
| 24 | void SleepForSeconds(double sleep_seconds) { |
| 25 | if (sleep_seconds <= 0.0) { |
| 26 | return; |
| 27 | } |
| 28 | // If requested, sleep between runs for an arbitrary amount of time. |
| 29 | // This can be helpful to determine the effect of mobile processor |
| 30 | // scaling and thermal throttling. |
| 31 | tflite::profiling::time::SleepForMicros( |
| 32 | static_cast<uint64_t>(sleep_seconds * 1e6)); |
| 33 | } |
| 34 | |
| 35 | } // namespace util |
| 36 | } // namespace benchmark |