#-*- coding:utf-8 -*-
import threading
from time import ctime,sleep
class MySuit(object):
def __init__(self):
pass
def StartTime(self,number):
print number,"开始时间是",ctime()
sleep(5)
print number,"结束时间是",ctime()
# 主函数入口
if __name__ == '__main__':
print 'start:', ctime()
threads = []
for index in range(0,2000):
# 实例化对象
mysuit = MySuit()
mysuit = MySuit()
t1 = threading.Thread(target=mysuit.StartTime, args=(index,))
threads.append(t1)
for t in threads:
t.setDaemon(True)
t.setDaemon(True)
t.start()
t.join()
print 'all end:', ctime()