Advertisement
Guest User

Untitled

a guest
Jul 27th, 2017
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.51 KB | None | 0 0
  1. import threading
  2. import datetime
  3. import gc
  4. import random
  5.        
  6. class ThreadClass(threading.Thread):
  7.     def run(self):
  8.         now = datetime.datetime.now()
  9.         for i in range(10):
  10.             random.random()
  11.         print "%s says Hello World at time: %s\n" %(self.getName(), now)
  12. now = datetime.datetime.now()
  13. print "Program started at %s." %(now)
  14.  
  15. for i in range(30):
  16.     t = ThreadClass()
  17.     t.start()
  18. now = datetime.datetime.now()
  19. print "Multithread completed %s." %(now)
  20.  
  21. x = raw_input()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement