2016-10-09 5 views
1

monontonic_time/1使用して、私のシェルだけでsecondsなくseconddocsあたりとして)単位を受け付けます。それ以外のerlang:monotonic_time badarg - ドキュメントは間違っていますか?

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を実行しています。

+3

あなたは19.0にありますか?これらは19.1で追加されました:https://github.com/erlang/otp/commit/412b5aaa5810cbac75ef41d29a36898ff1480129 – Dogbert

+0

@ A.Saridこれは19.1と19.1の両方で 'seconds'(19.1で廃止予定)が動作するのに対し、' second'(新しいもの)19.1でのみ動作しますか?または私はあなたを誤解しましたか? – Dogbert

+0

@Dogbertええ、私は19.0です!ありがとう、彼らは19に追加されたと思った。 – drozzy

答えて

6

あなたはおそらく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 
+0

@drozzy編集のおかげで! – Dogbert

関連する問題