Module:Timing/doc: Difference between revisions

Content deleted Content added
No edit summary
Line 11:
 
==Usage==
This module is not for use in ordinary templates, or on pages, it is to be used in the debug console below the edit window on module pages. For example, assume we open a page [[Module:HelloWorld]], then we can write a call to profile the function p.helloWorldhello(). The code in the page looks something like the example below, but local versions may be a little different. (At ''nowiki'' thea followingsimilar code is at [[w:no:Module:HelloWorld2]].)
 
<source lang="Lua">
local pmy_object = {};
 
my_object.hello = function( frame )
function p.helloWorld()
local str = "Hello World!"
return "Hi there!"
return str
end
 
return pmy_object
</source>
 
Line 26 ⟶ 27:
 
<source lang="Lua">
=require 'Module:Timing'(p.helloWorldhello)
</source>
 
Line 32 ⟶ 33:
 
<pre>
=require 'Module:Timing'(p.heihello,1000,100)
Each call was running for about 6.20966E-9 seconds. Mean run time for each set was 6.20966E-6 seconds,
with a standard deviation of 5.6091767397007E-6 seconds. Total time spent was about 0.010717389 seconds.