import timetime.sleep(5) # Delays for 5 seconds. You can also use a float value.
这是另一个示例,其中某件事大约每分钟运行一次:
import timewhile True: print("This prints once a minute.") time.sleep(60) # Delay for 1 minute (60 seconds).
import timetime.sleep(5) # Delays for 5 seconds. You can also use a float value.
这是另一个示例,其中某件事大约每分钟运行一次:
import timewhile True: print("This prints once a minute.") time.sleep(60) # Delay for 1 minute (60 seconds).