daily pastebin goal
18%
SHARE
TWEET

Untitled

a guest Mar 19th, 2019 68 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. roboRIO-5893-FRC:~$ # on a 2017 roboRIO image
  2. roboRIO-5893-FRC:~$ cat test.py        
  3. import hal
  4. import sys
  5. import time
  6. import timeit
  7. import threading
  8.  
  9. def timer(): return timeit.timeit(hal.observeUserProgramTest)
  10.  
  11. def main():
  12.   threads = [threading.Thread(target=timer) for _ in range(10)]
  13.  
  14.   for t in threads: t.start()
  15.  
  16.   for t in threads: t.join()
  17.  
  18. if 'once' in sys.argv:
  19.   print(timer())
  20. else:
  21.   main()
  22. roboRIO-5893-FRC:~$ time python3 test.py
  23.  
  24. real    9m31.739s
  25. user    3m40.460s
  26. sys     7m40.210s
  27. roboRIO-5893-FRC:~$ time python3 test.py once
  28. 35.66481052600011
  29.  
  30. real    0m37.715s
  31. user    0m12.780s
  32. sys     0m13.260s
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top