Advertisement
Guest User

Untitled

a guest
Jun 23rd, 2021
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.49 KB | None | 0 0
  1. # produce formatted hh:mm:ss.sss timestamp from timestamp_cycles
  2. timestamp_ms = timestamp_cycles // 200000
  3. timestamp_s = ( timestamp_ms % 60000 ) / 1000
  4. timestamp_m = timestamp_ms // 60000
  5. timestamp_h = timestamp_m // 60
  6. timestamp_m = timestamp_m % 60
  7. timestamp = f'{timestamp_h:02d}:{timestamp_m:02d}:{timestamp_s:06.3f}'
  8.  
  9.  
  10. # produce formatted h:mm:ss.ssssss timestamp from timestamp_cycles
  11. from datetime import timedelta
  12. timestamp = f'{timedelta(microseconds=timestamp_cycles // 200)}'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement