python3 线程 锁 线程池
线程使用
方式1 创建并立即执行
import _thread as thread
import time
# 为线程定义一个函数
def customize_function(thread_name, delay):
sum = 0
while sum < 5:
time.sleep(delay) # 休眠时间,单位秒
sum += 1
print("%s: %s" % (thread_name, time.ctime.
原创
2020-05-26 12:16:46 ·
722 阅读 ·
0 评论