aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRickard Green <[email protected]>2016-09-29 17:27:37 +0200
committerRickard Green <[email protected]>2016-09-29 17:27:37 +0200
commit4de2006a6fed05e6b524c56ad16b6e62a9d00817 (patch)
tree6fbcf7a565a4b5159c118bae3775230e0418252a
parent830d1bf2e5acaad3c720a001ad338841993feacc (diff)
parent5e57b3faccba1ae66ebd40fed23f5770eee71b04 (diff)
downloadotp-4de2006a6fed05e6b524c56ad16b6e62a9d00817.tar.gz
otp-4de2006a6fed05e6b524c56ad16b6e62a9d00817.tar.bz2
otp-4de2006a6fed05e6b524c56ad16b6e62a9d00817.zip
Merge branch 'rickard/time-unit/OTP-13831'
* rickard/time-unit/OTP-13831: Replace usage of deprecated time units
-rw-r--r--lib/compiler/src/compile.erl2
-rw-r--r--lib/compiler/src/compiler.app.src2
-rw-r--r--lib/hipe/main/hipe.app.src2
-rw-r--r--lib/hipe/tools/hipe_timer.erl6
-rw-r--r--lib/kernel/doc/src/seq_trace.xml4
-rw-r--r--lib/kernel/src/inet_db.erl3
-rw-r--r--lib/kernel/src/kernel.app.src2
-rw-r--r--lib/kernel/test/erl_distribution_SUITE.erl4
-rw-r--r--lib/kernel/test/file_SUITE.erl2
-rw-r--r--lib/kernel/test/gen_tcp_misc_SUITE.erl2
-rw-r--r--lib/kernel/test/interactive_shell_SUITE.erl2
-rw-r--r--lib/kernel/test/os_SUITE.erl2
-rw-r--r--lib/percept/src/percept.app.src2
-rw-r--r--lib/percept/src/percept.erl4
-rw-r--r--lib/percept/test/percept_SUITE.erl8
-rw-r--r--lib/stdlib/src/dets.erl2
-rw-r--r--lib/stdlib/src/stdlib.app.src2
-rw-r--r--lib/stdlib/src/timer.erl6
-rw-r--r--lib/stdlib/test/ets_SUITE.erl10
-rw-r--r--lib/stdlib/test/io_proto_SUITE.erl2
-rw-r--r--lib/stdlib/test/timer_SUITE.erl2
-rw-r--r--lib/stdlib/test/timer_simple_SUITE.erl2
22 files changed, 37 insertions, 36 deletions
diff --git a/lib/compiler/src/compile.erl b/lib/compiler/src/compile.erl
index 16621d9b43..e4fb703939 100644
--- a/lib/compiler/src/compile.erl
+++ b/lib/compiler/src/compile.erl
@@ -360,7 +360,7 @@ run_tc({Name,Fun}, St) ->
T1 = erlang:monotonic_time(),
Val = (catch Fun(St)),
T2 = erlang:monotonic_time(),
- Elapsed = erlang:convert_time_unit(T2 - T1, native, milli_seconds),
+ Elapsed = erlang:convert_time_unit(T2 - T1, native, millisecond),
Mem0 = erts_debug:flat_size(Val)*erlang:system_info(wordsize),
Mem = lists:flatten(io_lib:format("~.1f kB", [Mem0/1024])),
io:format(" ~-30s: ~10.3f s ~12s\n",
diff --git a/lib/compiler/src/compiler.app.src b/lib/compiler/src/compiler.app.src
index b205c7f50a..20195ac36f 100644
--- a/lib/compiler/src/compiler.app.src
+++ b/lib/compiler/src/compiler.app.src
@@ -72,5 +72,5 @@
{registered, []},
{applications, [kernel, stdlib]},
{env, []},
- {runtime_dependencies, ["stdlib-2.5","kernel-4.0","hipe-3.12","erts-7.0",
+ {runtime_dependencies, ["stdlib-2.5","kernel-4.0","hipe-3.12","erts-9.0",
"crypto-3.6"]}]}.
diff --git a/lib/hipe/main/hipe.app.src b/lib/hipe/main/hipe.app.src
index 96bcf7d7e8..af2c02006d 100644
--- a/lib/hipe/main/hipe.app.src
+++ b/lib/hipe/main/hipe.app.src
@@ -232,4 +232,4 @@
{applications, [kernel,stdlib]},
{env, []},
{runtime_dependencies, ["syntax_tools-1.6.14","stdlib-2.5","kernel-3.0",
- "erts-7.1","compiler-5.0"]}]}.
+ "erts-9.0","compiler-5.0"]}]}.
diff --git a/lib/hipe/tools/hipe_timer.erl b/lib/hipe/tools/hipe_timer.erl
index 72aa25d440..90bd0bb81f 100644
--- a/lib/hipe/tools/hipe_timer.erl
+++ b/lib/hipe/tools/hipe_timer.erl
@@ -51,7 +51,7 @@ empty_time() ->
{A,_} = erlang:statistics(runtime),
WTB = erlang:monotonic_time(),
{B,_} = erlang:statistics(runtime),
- {(WTB-WTA)/erlang:convert_time_unit(1, seconds, native),B-A}.
+ {(WTB-WTA)/erlang:convert_time_unit(1, second, native),B-A}.
time(F) ->
WTA = erlang:monotonic_time(),
@@ -59,7 +59,7 @@ time(F) ->
F(),
WTB = erlang:monotonic_time(),
{B,_} = erlang:statistics(runtime),
- {(WTB-WTA)/erlang:convert_time_unit(1, seconds, native),B-A}.
+ {(WTB-WTA)/erlang:convert_time_unit(1, second, native),B-A}.
timer(F) ->
WTA = erlang:monotonic_time(),
@@ -67,7 +67,7 @@ timer(F) ->
R = F(),
WTB = erlang:monotonic_time(),
{B,_} = erlang:statistics(runtime),
- {R,{(WTB-WTA)/erlang:convert_time_unit(1, seconds, native),B-A}}.
+ {R,{(WTB-WTA)/erlang:convert_time_unit(1, second, native),B-A}}.
advanced(_Fun, I) when I < 2 -> false;
advanced(Fun, Iterations) ->
diff --git a/lib/kernel/doc/src/seq_trace.xml b/lib/kernel/doc/src/seq_trace.xml
index 5ac199b6a7..ba7259219d 100644
--- a/lib/kernel/doc/src/seq_trace.xml
+++ b/lib/kernel/doc/src/seq_trace.xml
@@ -129,7 +129,7 @@ seq_trace:set_token(OldToken), % activate the trace token again
<seealso marker="erts:time_correction#Erlang_Monotonic_Time">Erlang
monotonic time</seealso> and a monotonically increasing
integer. The time-stamp has the same format and value
- as produced by <c>{erlang:monotonic_time(nano_seconds),
+ as produced by <c>{erlang:monotonic_time(nanosecond),
erlang:unique_integer([monotonic])}</c>.</p>
</item>
<tag><c>set_token(monotonic_timestamp, <anno>Bool</anno>)</c></tag>
@@ -141,7 +141,7 @@ seq_trace:set_token(OldToken), % activate the trace token again
<seealso marker="erts:time_correction#Erlang_Monotonic_Time">Erlang
monotonic time</seealso>. The time-stamp has the same
format and value as produced by
- <c>erlang:monotonic_time(nano_seconds)</c>.</p>
+ <c>erlang:monotonic_time(nanosecond)</c>.</p>
</item>
</taglist>
<p>If multiple timestamp flags are passed, <c>timestamp</c> has
diff --git a/lib/kernel/src/inet_db.erl b/lib/kernel/src/inet_db.erl
index 465cec1b45..6cbb6ac2da 100644
--- a/lib/kernel/src/inet_db.erl
+++ b/lib/kernel/src/inet_db.erl
@@ -1379,7 +1379,8 @@ cache_rr(_Db, Cache, RR) ->
ets:insert(Cache, RR).
times() ->
- erlang:convert_time_unit(erlang:monotonic_time() - erlang:system_info(start_time),native,seconds).
+ erlang:convert_time_unit(erlang:monotonic_time() - erlang:system_info(start_time),
+ native, second).
%% lookup and remove old entries
diff --git a/lib/kernel/src/kernel.app.src b/lib/kernel/src/kernel.app.src
index 56d1699656..4d08a55c7c 100644
--- a/lib/kernel/src/kernel.app.src
+++ b/lib/kernel/src/kernel.app.src
@@ -118,6 +118,6 @@
{applications, []},
{env, [{error_logger, tty}]},
{mod, {kernel, []}},
- {runtime_dependencies, ["erts-8.0", "stdlib-3.0", "sasl-3.0"]}
+ {runtime_dependencies, ["erts-9.0", "stdlib-3.0", "sasl-3.0"]}
]
}.
diff --git a/lib/kernel/test/erl_distribution_SUITE.erl b/lib/kernel/test/erl_distribution_SUITE.erl
index e43be77428..f630896e03 100644
--- a/lib/kernel/test/erl_distribution_SUITE.erl
+++ b/lib/kernel/test/erl_distribution_SUITE.erl
@@ -230,7 +230,7 @@ time_ping(Node) ->
T0 = erlang:monotonic_time(),
pang = net_adm:ping(Node),
T1 = erlang:monotonic_time(),
- erlang:convert_time_unit(T1 - T0, native, milli_seconds).
+ erlang:convert_time_unit(T1 - T0, native, millisecond).
%% Keep the connection with the client node up.
%% This is neccessary as the client node runs with much shorter
@@ -274,7 +274,7 @@ tick_cli_test1(Node) ->
receive
{whats_the_result, From} ->
Diff = erlang:convert_time_unit(T2-T1, native,
- milli_seconds),
+ millisecond),
case Diff of
T when T > 8000, T < 16000 ->
From ! {tick_test, T};
diff --git a/lib/kernel/test/file_SUITE.erl b/lib/kernel/test/file_SUITE.erl
index c37d114a58..f2094431d8 100644
--- a/lib/kernel/test/file_SUITE.erl
+++ b/lib/kernel/test/file_SUITE.erl
@@ -3738,7 +3738,7 @@ response_analysis(Module, Function, Arguments) ->
{Result, Comment}.
micro_ts() ->
- erlang:monotonic_time(micro_seconds).
+ erlang:monotonic_time(microsecond).
response_stat(init, Ts) ->
{0, 0, Ts, 0, 0};
diff --git a/lib/kernel/test/gen_tcp_misc_SUITE.erl b/lib/kernel/test/gen_tcp_misc_SUITE.erl
index 6b64c83fc2..929f66d400 100644
--- a/lib/kernel/test/gen_tcp_misc_SUITE.erl
+++ b/lib/kernel/test/gen_tcp_misc_SUITE.erl
@@ -1914,7 +1914,7 @@ so_priority(Config) when is_list(Config) ->
%% Accept test utilities (suites are below)
millis() ->
- erlang:monotonic_time(milli_seconds).
+ erlang:monotonic_time(millisecond).
collect_accepts(0,_) -> [];
collect_accepts(N,Tmo) ->
diff --git a/lib/kernel/test/interactive_shell_SUITE.erl b/lib/kernel/test/interactive_shell_SUITE.erl
index fc3706ba1e..298a364a91 100644
--- a/lib/kernel/test/interactive_shell_SUITE.erl
+++ b/lib/kernel/test/interactive_shell_SUITE.erl
@@ -711,7 +711,7 @@ toerl_loop(Port,Acc) ->
end.
millistamp() ->
- erlang:monotonic_time(milli_seconds).
+ erlang:monotonic_time(millisecond).
get_data_within(Port, X, Acc) when X =< 0 ->
?dbg({get_data_within, X, Acc, ?LINE}),
diff --git a/lib/kernel/test/os_SUITE.erl b/lib/kernel/test/os_SUITE.erl
index e76d6ec482..3cbb75a633 100644
--- a/lib/kernel/test/os_SUITE.erl
+++ b/lib/kernel/test/os_SUITE.erl
@@ -322,7 +322,7 @@ perf_counter_api(_Config) ->
T1 = os:perf_counter(),
timer:sleep(100),
T2 = os:perf_counter(),
- TsDiff = erlang:convert_time_unit(T2 - T1, perf_counter, nano_seconds),
+ TsDiff = erlang:convert_time_unit(T2 - T1, perf_counter, nanosecond),
ct:pal("T1: ~p~n"
"T2: ~p~n"
"TsDiff: ~p~n",
diff --git a/lib/percept/src/percept.app.src b/lib/percept/src/percept.app.src
index 1749730f97..ab0d9a4d90 100644
--- a/lib/percept/src/percept.app.src
+++ b/lib/percept/src/percept.app.src
@@ -38,7 +38,7 @@
{applications, [kernel,stdlib]},
{env,[]},
{runtime_dependencies, ["stdlib-2.0","runtime_tools-1.8.14","kernel-3.0",
- "inets-5.10","erts-6.0"]}
+ "inets-5.10","erts-9.0"]}
]}.
diff --git a/lib/percept/src/percept.erl b/lib/percept/src/percept.erl
index 046e0b7518..25c6ae19b1 100644
--- a/lib/percept/src/percept.erl
+++ b/lib/percept/src/percept.erl
@@ -217,7 +217,7 @@ stop_webserver(Port) ->
parse_and_insert(Filename, DB) ->
io:format("Parsing: ~p ~n", [Filename]),
- T0 = erlang:monotonic_time(milli_seconds),
+ T0 = erlang:monotonic_time(millisecond),
Pid = dbg:trace_client(file, Filename, mk_trace_parser(self())),
Ref = erlang:monitor(process, Pid),
parse_and_insert_loop(Filename, Pid, Ref, DB, T0).
@@ -230,7 +230,7 @@ parse_and_insert_loop(Filename, Pid, Ref, DB, T0) ->
{parse_complete, {Pid, Count}} ->
receive {'DOWN', Ref, process, Pid, normal} -> ok after 0 -> ok end,
DB ! {action, consolidate},
- T1 = erlang:monotonic_time(milli_seconds),
+ T1 = erlang:monotonic_time(millisecond),
io:format("Parsed ~w entries in ~w ms.~n", [Count, T1 - T0]),
io:format(" ~p created processes.~n", [length(percept_db:select({information, procs}))]),
io:format(" ~p opened ports.~n", [length(percept_db:select({information, ports}))]),
diff --git a/lib/percept/test/percept_SUITE.erl b/lib/percept/test/percept_SUITE.erl
index fbc77302ae..2be8b70e0d 100644
--- a/lib/percept/test/percept_SUITE.erl
+++ b/lib/percept/test/percept_SUITE.erl
@@ -79,9 +79,9 @@ analyze(Config) when is_list(Config) ->
Begin = processes(),
Path = proplists:get_value(data_dir, Config),
File = filename:join([Path,"profile_test.dat"]),
- T0 = erlang:monotonic_time(milli_seconds),
+ T0 = erlang:monotonic_time(millisecond),
ok = percept:analyze(File),
- T1 = erlang:monotonic_time(milli_seconds),
+ T1 = erlang:monotonic_time(millisecond),
io:format("percept:analyze/1 took ~w ms.~n", [T1 - T0]),
{stopped, _} = percept_db:stop(),
print_remainers(remainers(Begin, processes())),
@@ -92,9 +92,9 @@ analyze_dist(Config) when is_list(Config) ->
Begin = processes(),
Path = proplists:get_value(data_dir, Config),
File = filename:join([Path,"ipc-dist.dat"]),
- T0 = erlang:monotonic_time(milli_seconds),
+ T0 = erlang:monotonic_time(millisecond),
ok = percept:analyze(File),
- T1 = erlang:monotonic_time(milli_seconds),
+ T1 = erlang:monotonic_time(millisecond),
io:format("percept:analyze/1 took ~w ms.~n", [T1 - T0]),
{stopped, _} = percept_db:stop(),
print_remainers(remainers(Begin, processes())),
diff --git a/lib/stdlib/src/dets.erl b/lib/stdlib/src/dets.erl
index bf22949870..8ce29f23d3 100644
--- a/lib/stdlib/src/dets.erl
+++ b/lib/stdlib/src/dets.erl
@@ -3305,7 +3305,7 @@ time_now() ->
make_timestamp(MonTime, TimeOffset) ->
ErlangSystemTime = erlang:convert_time_unit(MonTime+TimeOffset,
native,
- micro_seconds),
+ microsecond),
MegaSecs = ErlangSystemTime div 1000000000000,
Secs = ErlangSystemTime div 1000000 - MegaSecs*1000000,
MicroSecs = ErlangSystemTime rem 1000000,
diff --git a/lib/stdlib/src/stdlib.app.src b/lib/stdlib/src/stdlib.app.src
index 09176d2ca0..8cf46482dd 100644
--- a/lib/stdlib/src/stdlib.app.src
+++ b/lib/stdlib/src/stdlib.app.src
@@ -106,7 +106,7 @@
dets]},
{applications, [kernel]},
{env, []},
- {runtime_dependencies, ["sasl-3.0","kernel-5.0","erts-8.0","crypto-3.3",
+ {runtime_dependencies, ["sasl-3.0","kernel-5.0","erts-9.0","crypto-3.3",
"compiler-5.0"]}
]}.
diff --git a/lib/stdlib/src/timer.erl b/lib/stdlib/src/timer.erl
index ca868627a9..df10790ea0 100644
--- a/lib/stdlib/src/timer.erl
+++ b/lib/stdlib/src/timer.erl
@@ -165,7 +165,7 @@ tc(F) ->
T1 = erlang:monotonic_time(),
Val = F(),
T2 = erlang:monotonic_time(),
- Time = erlang:convert_time_unit(T2 - T1, native, micro_seconds),
+ Time = erlang:convert_time_unit(T2 - T1, native, microsecond),
{Time, Val}.
%%
@@ -180,7 +180,7 @@ tc(F, A) ->
T1 = erlang:monotonic_time(),
Val = apply(F, A),
T2 = erlang:monotonic_time(),
- Time = erlang:convert_time_unit(T2 - T1, native, micro_seconds),
+ Time = erlang:convert_time_unit(T2 - T1, native, microsecond),
{Time, Val}.
%%
@@ -196,7 +196,7 @@ tc(M, F, A) ->
T1 = erlang:monotonic_time(),
Val = apply(M, F, A),
T2 = erlang:monotonic_time(),
- Time = erlang:convert_time_unit(T2 - T1, native, micro_seconds),
+ Time = erlang:convert_time_unit(T2 - T1, native, microsecond),
{Time, Val}.
%%
diff --git a/lib/stdlib/test/ets_SUITE.erl b/lib/stdlib/test/ets_SUITE.erl
index e726a29c9e..9a14c7014c 100644
--- a/lib/stdlib/test/ets_SUITE.erl
+++ b/lib/stdlib/test/ets_SUITE.erl
@@ -4446,15 +4446,15 @@ build_table2(L1,L2,Num) ->
T.
time_match_object(Tab,Match, Res) ->
- T1 = erlang:monotonic_time(micro_seconds),
+ T1 = erlang:monotonic_time(microsecond),
Res = ets:match_object(Tab,Match),
- T2 = erlang:monotonic_time(micro_seconds),
+ T2 = erlang:monotonic_time(microsecond),
T2 - T1.
time_match(Tab,Match) ->
- T1 = erlang:monotonic_time(micro_seconds),
+ T1 = erlang:monotonic_time(microsecond),
ets:match(Tab,Match),
- T2 = erlang:monotonic_time(micro_seconds),
+ T2 = erlang:monotonic_time(microsecond),
T2 - T1.
seventyfive_percent_success(_,S,Fa,0) ->
@@ -6276,7 +6276,7 @@ do_tc(Do, Report) ->
T1 = erlang:monotonic_time(),
Do(),
T2 = erlang:monotonic_time(),
- Elapsed = erlang:convert_time_unit(T2 - T1, native, milli_seconds),
+ Elapsed = erlang:convert_time_unit(T2 - T1, native, millisecond),
Report(Elapsed).
syrup_factor() ->
diff --git a/lib/stdlib/test/io_proto_SUITE.erl b/lib/stdlib/test/io_proto_SUITE.erl
index 1e286a9306..db321d7490 100644
--- a/lib/stdlib/test/io_proto_SUITE.erl
+++ b/lib/stdlib/test/io_proto_SUITE.erl
@@ -1715,7 +1715,7 @@ toerl_loop(Port,Acc) ->
end.
millistamp() ->
- erlang:monotonic_time(milli_seconds).
+ erlang:monotonic_time(millisecond).
get_data_within(Port, X, Acc) when X =< 0 ->
?dbg({get_data_within, X, Acc, ?LINE}),
diff --git a/lib/stdlib/test/timer_SUITE.erl b/lib/stdlib/test/timer_SUITE.erl
index 5fc95b16a6..9062cbae80 100644
--- a/lib/stdlib/test/timer_SUITE.erl
+++ b/lib/stdlib/test/timer_SUITE.erl
@@ -353,7 +353,7 @@ res_combine({error,Es}, [{error,E}|T]) ->
system_time() ->
- erlang:monotonic_time(milli_seconds).
+ erlang:monotonic_time(millisecond).
%% ------------------------------------------------------- %%
diff --git a/lib/stdlib/test/timer_simple_SUITE.erl b/lib/stdlib/test/timer_simple_SUITE.erl
index ff5116b8b6..1a582ae95a 100644
--- a/lib/stdlib/test/timer_simple_SUITE.erl
+++ b/lib/stdlib/test/timer_simple_SUITE.erl
@@ -457,7 +457,7 @@ append([],X) ->
X.
system_time() ->
- erlang:monotonic_time(micro_seconds).
+ erlang:monotonic_time(microsecond).
%% ------------------------------------------------------- %%