Advertisement
Guest User

python3.3 threading

a guest
Jul 5th, 2013
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.31 KB | None | 0 0
  1. import threading
  2. import time
  3.  
  4. def f(t_time):
  5.     end = time.time() + t_time
  6.     i = 0
  7.     while time.time() < end:
  8.         i = i + 1
  9.     print(end)
  10.  
  11. tl = []
  12. for row in [3, 6]:
  13.     t = threading.Thread(target=f, args=(row,))
  14.     tl.append(t)
  15.  
  16. for row in tl:
  17.     row.start()
  18. for row in tl:
  19.     row.join()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement