From 1d4472c3e6bad242c04ab5925ac12b3053ece323 Mon Sep 17 00:00:00 2001 From: Dan Gudmundsson Date: Wed, 30 Mar 2011 12:50:03 +0200 Subject: Add timer:tc/1 which measures elapsed time for a fun/0 Also removes the 'catch' from timer:tc functions which masked errors in measuring code. --- lib/stdlib/doc/src/timer.xml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'lib/stdlib/doc/src') diff --git a/lib/stdlib/doc/src/timer.xml b/lib/stdlib/doc/src/timer.xml index cae655f801..0baeff1db3 100644 --- a/lib/stdlib/doc/src/timer.xml +++ b/lib/stdlib/doc/src/timer.xml @@ -203,6 +203,7 @@ tc(Module, Function, Arguments) -> {Time, Value} tc(Fun, Arguments) -> {Time, Value} + tc(Fun) -> {Time, Value} Measure the real time it takes to evaluate apply(Module, Function, Arguments) or apply(Fun, Arguments) @@ -218,7 +219,7 @@ tc/3

Evaluates apply(Module, Function, Arguments) and measures - the elapsed real time as reported by now/0. + the elapsed real time as reported by os:timestamp/0. Returns {Time, Value}, where Time is the elapsed real time in microseconds, and Value is what is returned from the apply.

@@ -228,6 +229,11 @@

Evaluates apply(Fun, Arguments). Otherwise works like tc/3.

+ tc/1 + +

Evaluates Fun(). Otherwise works like tc/2.

+
+
-- cgit v1.2.3