Module:Sandbox/Johnuniq/testpre

Revision as of 23:11, 21 August 2018 by imported>Johnuniq (36000 is too many dates (gives "not enough memory"))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Documentation for this module may be created at Module:Sandbox/Johnuniq/testpre/doc

-- How many dates can Scribunto fit in the allowed 50 MB of memory?

local Date = require('Module:Date')._Date

local function main(frame)
	local count = tonumber(frame.args[1]) or 31000
	local jd = 2451545
	local dates = {}
	for i = 1, count do
		dates[i] = Date('juliandate', jd)
		jd = jd + 1
	end
	return 'Number of dates = ' .. count
end

return { main = main }