diff options
author | Christopher Faulet <[email protected]> | 2010-04-06 22:39:14 +0200 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2010-04-09 14:57:15 +0200 |
commit | 2cca6506bafedc5ebb720510151a98602133d8e5 (patch) | |
tree | b34db2ee7fc3750a914330a2c692f6b06b7540bd /lib/stdlib/doc/src/timer.xml | |
parent | e44595eab24f92fe33d1feea44e422bcb7c53824 (diff) | |
download | otp-2cca6506bafedc5ebb720510151a98602133d8e5.tar.gz otp-2cca6506bafedc5ebb720510151a98602133d8e5.tar.bz2 otp-2cca6506bafedc5ebb720510151a98602133d8e5.zip |
Add timer:tc/2 to measure the elapsed time of anonymous functions
Works like timer:tc/3 but for anonymous functions.
Diffstat (limited to 'lib/stdlib/doc/src/timer.xml')
-rw-r--r-- | lib/stdlib/doc/src/timer.xml | 24 |
1 files changed, 19 insertions, 5 deletions
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 @@ </func> <func> <name>tc(Module, Function, Arguments) -> {Time, Value}</name> - <fsummary>Measure the real time it takes to evaluate <c>apply(Module, Function, Arguments)</c></fsummary> + <name>tc(Fun, Arguments) -> {Time, Value}</name> + <fsummary>Measure the real time it takes to evaluate <c>apply(Module, + Function, Arguments)</c> or <c>apply(Fun, Arguments)</c></fsummary> <type> <v>Module = Function = atom()</v> + <v>Fun = fun()</v> <v>Arguments = [term()]</v> <v>Time = integer() in microseconds</v> <v>Value = term()</v> </type> <desc> - <p>Evaluates <c>apply(Module, Function, Arguments)</c> and measures - the elapsed real time. Returns <c>{Time, Value}</c>, where - <c>Time</c> is the elapsed real time in <em>microseconds</em>, - and <c>Value</c> is what is returned from the apply.</p> + <p></p> + <taglist> + <tag><c>tc/3</c></tag> + <item> + <p>Evaluates <c>apply(Module, Function, Arguments)</c> and measures + the elapsed real time. Returns <c>{Time, Value}</c>, where + <c>Time</c> is the elapsed real time in <em>microseconds</em>, + and <c>Value</c> is what is returned from the apply.</p> + </item> + <tag><c>tc/2</c></tag> + <item> + <p>Evaluates <c>apply(Fun, Arguments)</c>. Otherwise works + like <c>tc/3</c>.</p> + </item> + </taglist> </desc> </func> <func> |