nlopes / actix-web-prom

Actix-web middleware to expose Prometheus metrics
MIT License
89 stars 56 forks source link

Use Instant vs SystemTime #55

Closed arthurlm closed 3 years ago

arthurlm commented 3 years ago

Instant is better to have precise time comparison.

Indeed it use a monotonic clock which is closer to an RTC clock than SystemTime.

See: https://doc.rust-lang.org/std/time/struct.Instant.html See: https://doc.rust-lang.org/std/time/struct.SystemTime.html

nlopes commented 3 years ago

This was a big oversight in my first pass. Thank you @arthurlm.