hardbyte / hardbyte/python-can

Store timestamps in nanosecond precision

Aperta
#722 0 commenti 2 reazioni 0 assegnatari Vedi su GitHub
enhancement
Lingua principale
Python
Stelle
1.6k
Fork
697
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

We currently store timestamps in float format while most interfaces and log formats use some integer representation. Converting these to floating point is a lossy operation.

My proposal is to add an additional `timestamp_ns` argument and attribute to the Message class. On initialization, if the `timestamp` argument is given it would be converted to ns. The `.timestamp` attribute can be dynamically calculated on get and set.

It would be fairly trivial to update the interfaces and log formats to use ns timestamps instead.

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.