def sleep_for_interval(self, start_ts, nseconds):
sleep_time = nseconds - (time.time() - start_ts)<EOL>if sleep_time <= <NUM_LIT:0>:<EOL><INDENT>return<EOL><DEDENT>self._logger.debug('<STR_LIT>', sleep_time)<EOL>sleep_time = nseconds - (time.time() - start_ts)<EOL>if sleep_time > <NUM_LIT:0>:<EOL><INDENT>time.sleep(sleep_time)<EOL><DEDENT>
Sleep for a given interval with respect to the start timestamp.

So, if the start timestamp is 1337 and nseconds is 10, the method will
actually sleep for nseconds - (current_timestamp - start_timestamp). So
if the current timestamp is 1340, we'll only sleep for 7 seconds (the
goal being to sleep until 1347, or 1337 + 10).