aboutsummaryrefslogtreecommitdiffstats
path: root/lib/dialyzer/src/dialyzer_timing.erl
diff options
context:
space:
mode:
authorStavros Aronis <[email protected]>2012-03-05 11:39:28 +0100
committerHenrik Nord <[email protected]>2012-05-21 15:31:22 +0200
commit4a1fa04e5f57ad56e35aae8e9ff278bf1133889a (patch)
tree522ccc0093ae7910a03eef7e71b9156f5f9ebb7f /lib/dialyzer/src/dialyzer_timing.erl
parent49ccc5df4f2f64ff19dd5751523c8ba45adaf658 (diff)
downloadotp-4a1fa04e5f57ad56e35aae8e9ff278bf1133889a.tar.gz
otp-4a1fa04e5f57ad56e35aae8e9ff278bf1133889a.tar.bz2
otp-4a1fa04e5f57ad56e35aae8e9ff278bf1133889a.zip
Change --time to --statistics and include more info
Diffstat (limited to 'lib/dialyzer/src/dialyzer_timing.erl')
-rw-r--r--lib/dialyzer/src/dialyzer_timing.erl29
1 files changed, 22 insertions, 7 deletions
diff --git a/lib/dialyzer/src/dialyzer_timing.erl b/lib/dialyzer/src/dialyzer_timing.erl
index dc4d522c2f..c2a7b3ecf8 100644
--- a/lib/dialyzer/src/dialyzer_timing.erl
+++ b/lib/dialyzer/src/dialyzer_timing.erl
@@ -26,7 +26,7 @@
-module(dialyzer_timing).
--export([init/1, start_stamp/1, end_stamp/0, stop/0]).
+-export([init/1, start_stamp/1, send_size_info/2, end_stamp/0, stop/0]).
-spec init(boolean()) -> ok.
@@ -43,7 +43,7 @@ loop_init(Active) ->
case Active of
true ->
io:format("\n"),
- loop(now());
+ loop(now(), 0, "");
false -> dummy_loop()
end.
@@ -53,16 +53,25 @@ dummy_loop() ->
_ -> dummy_loop()
end.
-loop(LastNow) ->
+loop(LastNow, Size, Unit) ->
receive
{stamp, Msg, Now} ->
io:format(" ~-10s (+~4.2fs):", [Msg, diff(Now, LastNow)]),
- loop(Now);
+ loop(Now, 0, "");
{stamp, Now} ->
- io:format("~7.2fs\n", [diff(Now, LastNow)]),
- loop(Now);
+ SizeStr =
+ case Size of
+ 0 -> "";
+ _ ->
+ Data = io_lib:format("~p ~s",[Size, Unit]),
+ io_lib:format(" (~12s)",[Data])
+ end,
+ io:format("~7.2fs~s\n", [diff(Now, LastNow), SizeStr]),
+ loop(Now, 0, "");
+ {size, NewSize, NewUnit} ->
+ loop(LastNow, NewSize, NewUnit);
{Pid, stop, Now} ->
- io:format(" ~-10s (+~4.2fs)\n", ["",diff(Now, LastNow)]),
+ io:format(" ~-9s (+~5.2fs)\n", ["",diff(Now, LastNow)]),
Pid ! ok
end.
@@ -78,6 +87,12 @@ end_stamp() ->
?MODULE ! {stamp, now()},
ok.
+-spec send_size_info(integer(), string()) -> ok.
+
+send_size_info(Size, Unit) ->
+ ?MODULE ! {size, Size, Unit},
+ ok.
+
-spec stop() -> ok.
stop() ->