You can use floating-point numbers in sleep()
:
The argument may be a floating point number to indicate a more precise sleep time.
So
time.sleep(0.5)
will sleep for half a second.
In practice, however, it's unlikely that you will get much more than millisecond precision with sleep because operating systems usually only support millisecond sleeps and because very short amounts of time quickly get unreliable.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…