Advertisement
Guest User

Untitled

a guest
Jul 24th, 2016
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. import time
  2. from timeout import timeout
  3.  
  4. class Test(object):
  5. @timeout(2)
  6. def test_a(self, foo, bar):
  7. print foo
  8. time.sleep(1)
  9. print bar
  10. return 'A Done'
  11.  
  12. @timeout(2)
  13. def test_b(self, foo, bar):
  14. print foo
  15. time.sleep(3)
  16. print bar
  17. return 'B Done'
  18.  
  19. t = Test()
  20. print t.test_a('python', 'rocks')
  21. print t.test_b('timing', 'out')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement