Sleeps for (roughly) n milliseconds. This function is only for testing Google Test's own constructs. Don't use it in user tests, either directly or indirectly.
| 1429 | // Google Test's own constructs. Don't use it in user tests, either |
| 1430 | // directly or indirectly. |
| 1431 | inline void SleepMilliseconds(int n) { |
| 1432 | const timespec time = { |
| 1433 | 0, // 0 seconds. |
| 1434 | n * 1000L * 1000L, // And n ms. |
| 1435 | }; |
| 1436 | nanosleep(&time, nullptr); |
| 1437 | } |
| 1438 | # endif // GTEST_HAS_PTHREAD |
| 1439 | |
| 1440 | # if GTEST_HAS_NOTIFICATION_ |