erlang:monotonic_time badarg - 文档是不正确的?

时间:2016-10-09 08:48:25

标签: erlang

使用monontonic_time/1时,我的shell只接受单位seconds而非second(根据docs):

2> erlang:monotonic_time(seconds).
9

5> erlang:monotonic_time(second).
** exception error: bad argument
     in function  erlang:monotonic_time/1
        called as erlang:monotonic_time(second)

其他人有这个奇怪的问题吗? 我正在运行Erlang 19。

1 个答案:

答案 0 :(得分:5)

你可能在Erlang 19.0上。在this commit中添加了单数+非下划线版本,根据Github,包含此提交的第一个标记是OTP-19.1或Erlang / OTP版本19.1。我可以在Erlang 19.1确认secondseconds为我工作:

$ erl -eval '{ok, Version} = file:read_file(filename:join([code:root_dir(), "releases", erlang:system_info(otp_release), "OTP_VERSION"])), io:fwrite(Version), halt().' -noshell
19.1
$ erl
1> erlang:monotonic_time(second).
-576460744
2> erlang:monotonic_time(seconds).
-576460743