Open main menu
Home
Random
Donate
Recent changes
Special pages
Community portal
Preferences
About Stockhub
Disclaimers
Search
User menu
Talk
Contributions
Create account
Log in
Editing
Module:Timing/doc
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===Testing in a sandboxed environment=== If the module under test is sandboxed, that is under [[Special:MyPage/sandbox]], then the debugger is not directly available and we must put the testing inside the module itself. If we have a replacement module, then we add a requirement and a helper function Sometimes it is better to put the wrapper in the module under inspection itself <syntaxhighlight lang="lua"> local timing = require 'Module:Timing' my_object = {}; my_object.hello = function( frame ) local str = "Hi there World!" return str end my_object.TIMING = function (frame) return timing(my_object.hello) end return my_object </syntaxhighlight> This can them be used in [[Special:TemplateSandbox]] with a prefix from [[Special:MyPage/sandbox]] and any "render page" we see fit for the purpose. Often we want a specific page though to get access to additional data like the Wikidata item. Fill inn an invoke-call for our helper function <syntaxhighlight lang="html5"> {{#invoke|HelloWorld|TIMING}} </syntaxhighlight> and we will have a timing report for the helper call in the module.
Summary:
Please note that all contributions to Stockhub may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Stockhub:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)