Hacker News new | past | comments | ask | show | jobs | submit login

You should record the event time separately [1] from the beginning/end of the measurement period - the first as a time instant in UTC ('wall clock'), the latter as a difference between two values of a guaranteed monotonically increasing clock.

This is something you need to do regardless of leap seconds to handle things like NTP kicking in to adjust your local wall clock time.

[1] - Depending on the programming environment, these might be either different timestamp types recorded separately or converted appropriately to reflect different uses, or a smart combination type like time.Time in Go.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: