Skip to content

Commit

Permalink
Better tracking of time
Browse files Browse the repository at this point in the history
  • Loading branch information
gerth2 committed Oct 19, 2024
1 parent 080c533 commit ec69db7
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions robot.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def _testLoggingInit(self):
log(f"testSig{i}", i)

def _testLoggingMany(self):
for _ in range (0,100000):
for _ in range (0,1000):
for i in range(0,100):
log(f"testSig{i}", i)

Expand Down Expand Up @@ -106,12 +106,17 @@ def autonomousInit(self):
self.autoHasRun = True

# Test only
stats = None
self._testLoggingInit()
profiler = LineProfiler()
profiler.add_module(utils.signalLogging)
start = wpilib.Timer.getFPGATimestamp()
profiler.runcall(self._testLoggingMany)
end = wpilib.Timer.getFPGATimestamp()
profiler.print_stats()
print(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>")
print(f">>Overall Time: {end-start} sec")
print(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>")
sys.exit()


def autonomousPeriodic(self):
Expand Down

0 comments on commit ec69db7

Please sign in to comment.