-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinit.lua
More file actions
25 lines (21 loc) · 735 Bytes
/
init.lua
File metadata and controls
25 lines (21 loc) · 735 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
local modpath = minetest.get_modpath("benchmark")
local printall = function(string)
minetest.chat_send_all(string)
print(string)
end
minetest.register_chatcommand("benchmark", {
params = "",
description = "Benchmark the server (will stop everything for ~15 seconds)",
func = function(name, param)
if minetest.check_player_privs(name, {server=true}) then
printall("Starting Pi Benchmark")
local calpi = dofile(modpath .. "/calpi.lua")
printall("Pi took " .. calpi .. " seconds.")
--printall("Starting Mapgen Benchmark")
--local mapgen = dofile(modpath .. "/mapgen.lua")
--printall("Mapgen took: " .. mapgen .. "seconds.")
return true, "Done."
else return false, "Operation not permitted"
end
end
})