News for hackers. Stuff that matters.
Re:Postscript: Time Goes On (2014) by vbernat on Tuesday January 03, 2017 @05:23AM (#13308189)
Many languages get support for monotonic clocks in their standard lib with support on various OS.

- In C, clock_gettime() (POSIX.1-2001)

- In C++11, chrono::steady_clock()

- In Python, time.monotonic()

- In Ruby, Process.clock_gettime()

- In Erlang, see OP

- In Java, you have System.nanoTime()

IMO, all languages should follow this trend as it is an essential component for many stuff. Those are not just for leap seconds, but the system clock can go backward due to a user action.

In the case of Go, the problem has been advertised since some time (Go started to internally use a monotonic clock in Go 1.3) but is/was just ignored because it is/was deemed unimportant.

Re:Postscript: Time Goes On (2014) by orivej on Tuesday January 03, 2017 @02:42PM (#13312324)
> IMO, all languages should follow this trend as it is an essential component for many stuff.

On the one hand, using different kinds of clock (clock_realtime and clock_monotonic) for different purposes currently is the only robust option when deploying on systems you do not control. On the other hand, using just one monotonic wall clock [1] for all purposes on a properly configured system is so much simpler and intuitive for programmers that it is difficult to justify the burden of multiple clocks, all the more so its necessity.

Thanks for the list!

[1] https://developers.google.com/time/smear