Created
March 14, 2019 09:04
-
-
Save auscompgeek/cf1075c72bec2383712ec49c0400327f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment