Advertisement
Guest User

Untitled

a guest
Jun 14th, 2021
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. def timestamp_cycles(self):
  2. """Returns the current timestamp in PRU cycles (integer)"""
  3. self._last_timestamp_cycles += ( self.pruss.ecap.counter - self._last_timestamp_cycles ) & 0xffffffff
  4. return self._last_timestamp_cycles
  5.  
  6. def timestamp_ns(self):
  7. """Returns the current timestamp in nanoseconds (integer)"""
  8. return self.timestamp_cycles() * 5
  9.  
  10. def timestamp_seconds(self):
  11. """Returns the current timestamp in seconds (floating-point)"""
  12. return self.timestamp_cycles() / 200e6
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement