From 2cca6506bafedc5ebb720510151a98602133d8e5 Mon Sep 17 00:00:00 2001 From: Christopher Faulet Date: Tue, 6 Apr 2010 22:39:14 +0200 Subject: Add timer:tc/2 to measure the elapsed time of anonymous functions Works like timer:tc/3 but for anonymous functions. --- lib/stdlib/doc/src/timer.xml | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) (limited to 'lib/stdlib/doc') diff --git a/lib/stdlib/doc/src/timer.xml b/lib/stdlib/doc/src/timer.xml index 0b6807dd6c..3d54047e35 100644 --- a/lib/stdlib/doc/src/timer.xml +++ b/lib/stdlib/doc/src/timer.xml @@ -202,18 +202,32 @@ tc(Module, Function, Arguments) -> {Time, Value} - Measure the real time it takes to evaluate apply(Module, Function, Arguments) + tc(Fun, Arguments) -> {Time, Value} + Measure the real time it takes to evaluate apply(Module, + Function, Arguments) or apply(Fun, Arguments) Module = Function = atom() + Fun = fun() Arguments = [term()] Time = integer() in microseconds Value = term() -

Evaluates apply(Module, Function, Arguments) and measures - the elapsed real time. Returns {Time, Value}, where - Time is the elapsed real time in microseconds, - and Value is what is returned from the apply.

+

+ + tc/3 + +

Evaluates apply(Module, Function, Arguments) and measures + the elapsed real time. Returns {Time, Value}, where + Time is the elapsed real time in microseconds, + and Value is what is returned from the apply.

+
+ tc/2 + +

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

+
+
-- cgit v1.2.3