massivefermion / birl

datetime handling for gleam
https://hex.pm/packages/birl
Apache License 2.0
72 stars 9 forks source link

Erlang monotonic_now/1 function isn't monotonic #2

Closed lpil closed 1 year ago

lpil commented 1 year ago

Hello!

monotonic_now/1 is implemented using os:perf_counter/1, which isn't monotonic.

You may want to use erlang:system_info(os_monotonic_time_source). or erlang:monotonic_time/0 depending on what you want. More info there: https://www.erlang.org/doc/apps/erts/time_correction.html

Thanks, Louis

massivefermion commented 1 year ago

I definitely need to do more research on that. Thanks for the tips!

massivefermion commented 1 year ago

I made some changes and I think we can close this issue. And with #3 also probably closed, I'm ready for a new version so that we can move on to other issues. Let me know if I misunderstood something and the code still needs to change regarding this issue. Thanks for the feedback!

lpil commented 1 year ago

Fab!