import threading
import time
def loop01(in01):
print("start loop01 at : {0}".format(time.ctime()))
print("loop01参数:{0}".format(in01))
time.sleep(4)
print("end loop01 at : {0}".format(time.ctime()))
def loop02(in01, in02):
print('start loop02 at : {0}'.format(time.ctime()))
print("loop02参数,第一个参数{0},第二个参数{1}".format(in01,in02))
time.sleep(2)
print("end loop02 at : {0}".format(time.ctime()))
if name == 'main':
print("Starting at : {0}".format(time.ctime()))
t1 = threading.Thread(target=loop01,args=("loop01参数",))
t2 = threading.Thread(target=loop02,args=("loop02参数1","loop02参数2"))
t1.start()
t2.start()
t1.join()
t2.join()
print("All done at {0}".format(time.ctime()))
while True:
time.sleep(10)
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。