The time.sleep
documentation is the best:
The actual suspension time may be less than that requested because any caught signal will terminate the sleep() following execution of that signal’s catching routine.
But also:
Also, the suspension time may be longer than requested by an arbitrary amount because of the scheduling of other activity in the system.
So, there are no guarantees (this tripped me over as well in the past). You're getting a five second delay (roughly) but the actual delay can be a bit less and/or a bit more than the requested delay.