Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import threading
- import datetime
- import gc
- import random
- class ThreadClass(threading.Thread):
- def run(self):
- now = datetime.datetime.now()
- for i in range(10):
- random.random()
- print "%s says Hello World at time: %s\n" %(self.getName(), now)
- now = datetime.datetime.now()
- print "Program started at %s." %(now)
- for i in range(30):
- t = ThreadClass()
- t.start()
- now = datetime.datetime.now()
- print "Multithread completed %s." %(now)
- x = raw_input()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement