Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecation of erlang:now() #9

Closed
tchoutri opened this issue Feb 4, 2016 · 2 comments
Closed

Deprecation of erlang:now() #9

tchoutri opened this issue Feb 4, 2016 · 2 comments

Comments

@tchoutri
Copy link

tchoutri commented Feb 4, 2016

Maybe should you replace it with os:timestamp?

msantos added a commit that referenced this issue Feb 4, 2016
Switch from using the deprecated erlang:now/0 to os:timestamp/0 as
suggested by @tchoutri in #9

The erlang docs recommend using monotonically increasing values for
calculating elapsed time to avoid problems with time drift. Further work
should be done to use erlang:monotonic_time/0 where supported, falling
back to os:timestamp/0 on older erlang versions.

This behaviour follows "classic" versions of ping which rely on the
system clock and so may return impossible (negative) values for elapsed
time. OpenBSD's ping uses monotonically increasing values for the time.
@msantos
Copy link
Owner

msantos commented Feb 4, 2016

Done, thanks! I'll look at switching to erlang:monotonic_time/0 in the future.

@msantos msantos closed this as completed Feb 4, 2016
@tchoutri
Copy link
Author

tchoutri commented Feb 4, 2016

You're welcome. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants