in nailgun-client/py/ng.py [0:0]
def select(self, timeout_secs):
start = monotonic_time_nanos()
timeout_nanos = timeout_secs * NSEC_PER_SEC
while True:
readable, exceptional = self.select_now()
if (
readable
or exceptional
or monotonic_time_nanos() - start > timeout_nanos
):
return readable, exceptional
# Sleep a bit to avoid busy looping for no reason.
time.sleep(0.05)