Module:Sandbox/Vinifera7/test
Jump to navigation
Jump to search
You might want to create a documentation page for this module.
Editors can experiment in this module's sandbox and testcases pages.
Please add categories to the /doc subpage. Subpages of this module.
Editors can experiment in this module's sandbox and testcases pages.
Please add categories to the /doc subpage. Subpages of this module.
local m_util = require('Module:Util/sandbox')
local function _test1(args)
local t = os.clock()
local frame
local count = 0
for i = 1, args[1] do
frame = mw.getCurrentFrame()
count = count + 1
end
local out = string.format('Test 1 completed in %s seconds. %i', os.clock() - t, count)
mw.log(out)
return out
end
local function _test2(args)
local t = os.clock()
local frame
local count = 0
for i = 1, args[1] do
frame = m_util.misc.get_frame(frame)
count = count + 1
end
local out = string.format('Test 2 completed in %s seconds. %i', os.clock() - t, count)
mw.log(out)
return out
end
local p = {}
p.test1 = m_util.misc.invoker_factory(_test1, {
parentFirst = true,
})
p.test2 = m_util.misc.invoker_factory(_test2, {
parentFirst = true,
})
return p