我想编写一个无论如何都会在 5 秒后返回的函数:
def myfunction():
while passed_time < 5_seconds:
do1()
do2()
do3()
.
.
return
我的意思是,这个函数只运行 5 秒,5 秒后,它应该结束,并继续执行其他函数:
myfunction()
otherfunction() ----> This should start 5 seconds after myfunction() is executed.
此致