Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- roboRIO-5893-FRC:~$ # on a 2017 roboRIO image
- roboRIO-5893-FRC:~$ cat test.py
- import hal
- import sys
- import time
- import timeit
- import threading
- def timer(): return timeit.timeit(hal.observeUserProgramTest)
- def main():
- threads = [threading.Thread(target=timer) for _ in range(10)]
- for t in threads: t.start()
- for t in threads: t.join()
- if 'once' in sys.argv:
- print(timer())
- else:
- main()
- roboRIO-5893-FRC:~$ time python3 test.py
- real 9m31.739s
- user 3m40.460s
- sys 7m40.210s
- roboRIO-5893-FRC:~$ time python3 test.py once
- 35.66481052600011
- real 0m37.715s
- user 0m12.780s
- sys 0m13.260s
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement