Skip to content
This repository has been archived by the owner on Aug 20, 2020. It is now read-only.

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
ElementW committed Aug 10, 2016
0 parents commit fa7aa3d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# profilerdumper

Minetest mod that runs `/profiler dump` every `profilerdumper.interval` seconds (defaults to 5 min).

WTFPL / CC0 / Public Domain
11 changes: 11 additions & 0 deletions init.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
if minetest.chatcommands['profiler'] then
local function get_interval()
return minetest.setting_get('profilerdumper.interval') or 10*60
end
local function loop()
minetest.chatcommands['profiler'].func(nil, 'dump')
minetest.after(get_interval(), loop)
end
minetest.after(get_interval(), loop)
minetest.log('action', '[profilerdumper] Started with initial interval of ' .. get_interval())
end

0 comments on commit fa7aa3d

Please sign in to comment.