sdk/lib/fdio/tests/fdio_poll.cc
// These tests use poll/ppoll to sleep, and check both the return
// value, and that the an appropriate amount of time has passed.
//
// Since the point of these tests is not to establish that the
// underlying primitives sleep for the correct amount of time, the
// assertion about the amount of time advanced is pretty loose. We
// instruct poll/ppoll sleep for 10 milliseconds, and assert that at
// least 1 millisecond has elapsed. With those values, it is
// implausible that execution fell straight through the body of
// poll/ppoll without blocking, while also allowing this test to not
// have to reason about the precise guarantees made by the monotonic
// clock or blocking system calls.
These tests use poll/ppoll to sleep, and check both the return
value, and that the an appropriate amount of time has passed.

Since the point of these tests is not to establish that the
underlying primitives sleep for the correct amount of time, the
assertion about the amount of time advanced is pretty loose. We
instruct poll/ppoll sleep for 10 milliseconds, and assert that at
least 1 millisecond has elapsed. With those values, it is
implausible that execution fell straight through the body of
poll/ppoll without blocking, while also allowing this test to not
have to reason about the precise guarantees made by the monotonic
clock or blocking system calls.
These tests use poll / ppoll to sleep and check both the return value and that the an appropriate amount of time has passed . Since the point of these tests is not to establish that the underlying primitives sleep for the correct amount of time the assertion about the amount of time advanced is pretty loose . We instruct poll / ppoll sleep for 10 milliseconds and assert that at least 1 millisecond has elapsed . With those values it is implausible that execution fell straight through the body of poll / ppoll without blocking while also allowing this test to not have to reason about the precise guarantees made by the monotonic clock or blocking system calls .
timespec now() {
  timespec ts;
  clock_gettime(CLOCK_MONOTONIC, &ts);
  return ts;
}
timespec now ( ) { timespec ts ; clock_gettime ( CLOCK_MONOTONIC , & ts ) ; return ts ; }
These tests use poll/ppoll to sleep, and check both the return
value, and that the an appropriate amount of time has passed.
These tests use poll / ppoll to sleep and check both the return value and that the an appropriate amount of time has passed .