@@ -131,7 +131,7 @@ def __init__(self, period: wpimath.units.seconds = kDefaultPeriod) -> None:
131
131
132
132
self ._startTimeUs = _getFPGATime ()
133
133
self ._callbacks = _OrderedList ()
134
- self .loopStartTimeUs = 0
134
+ self ._loopStartTimeUs = 0
135
135
self .addPeriodic (self ._loopFunc , period = self ._periodS )
136
136
137
137
self ._notifier , status = initializeNotifier ()
@@ -183,7 +183,7 @@ def startCompetition(self) -> None:
183
183
# See the API for waitForNotifierAlarm
184
184
break
185
185
186
- self .loopStartTimeUs = _getFPGATime ()
186
+ self ._loopStartTimeUs = _getFPGATime ()
187
187
self ._runCallbackAndReschedule (callback , currentTimeUs )
188
188
189
189
# Process all other callbacks that are ready to run
@@ -204,22 +204,20 @@ def endCompetition(self) -> None:
204
204
"""
205
205
stopNotifier (self ._notifier )
206
206
207
- def getLoopStartTime (self ) -> wpimath . units . seconds :
207
+ def getLoopStartTime (self ) -> microsecondsAsInt :
208
208
"""
209
- todo was def getLoopStartTime(self) -> int: (Microseconds)
210
- todo this show be wpimath.units.seconds
211
- Return the system clock time in seconds (todo was microseconds)
209
+ Return the system clock time in microseconds
212
210
for the start of the current
213
- periodic loop. This is in the same time base as Timer.GetFPGATimestamp (),
211
+ periodic loop. This is in the same time base as Timer.getFPGATimestamp (),
214
212
but is stable through a loop. It is updated at the beginning of every
215
213
periodic callback (including the normal periodic loop).
216
214
217
- :returns: Robot running time in seconds (todo was microseconds) ,
215
+ :returns: Robot running time in microseconds,
218
216
as of the start of the current
219
217
periodic function.
220
218
"""
221
219
222
- return self .loopStartTimeUs / 1e6 # units are seconds
220
+ return self ._loopStartTimeUs
223
221
224
222
def addPeriodic (
225
223
self ,
0 commit comments