talostrading / sonic

Sonic is a Go library for network and I/O programming that provides developers with a consistent asynchronous model, with a focus on achieving the lowest possible latency and jitter in Go.
MIT License
676 stars 16 forks source link

move CLOCK_REALTIME to CLOCK_MONOTONIC #124

Closed KushnerykPavel closed 4 months ago

KushnerykPavel commented 6 months ago

resolve https://github.com/talostrading/sonic/issues/63 move CLOCK_REALTIME to CLOCK_MONOTONIC

ethanf commented 4 months ago

@sergiu128 is this the direction we want to go in?

sergiu128 commented 4 months ago

Sorry, missed it. I’m unsure if this would work 100% of the time, like when the system suspends. Also seems CLOCK MONOTONIC is susceptible to NTP skewing - I didn’t initially know this is the case.

I wouldn’t go through with this as I cannot guarantee correctness. I think we should stick to the realtime clock for now and in the future use the monotonic one only for time differences on the same machine, so timer object.