I just wrote a function that looked like this:
def block_for(seconds):
"""Wait at least seconds, this function should not be affected by the computer sleeping."""
end_time = datetime.datetime.now() + datetime.timedelta(seconds)
while datetime.datetime.now() < end_time:
pass
Can anything bad come of this? Should there ideally be something inside the while loop?