diff options
Diffstat (limited to 'script/tracy.lua')
-rw-r--r-- | script/tracy.lua | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/script/tracy.lua b/script/tracy.lua new file mode 100644 index 00000000..bf93a103 --- /dev/null +++ b/script/tracy.lua @@ -0,0 +1,30 @@ +local originTracy + +local function enable() + if not originTracy then + local suc = pcall(require, 'luatracy') + if suc then + originTracy = tracy + else + originTracy = { + ZoneBeginN = function (info) end, + ZoneEnd = function () end, + } + end + end + tracy = originTracy +end + +local function disable() + tracy = { + ZoneBeginN = function (info) end, + ZoneEnd = function () end, + } +end + +disable() + +return { + enable = enable, + disable = disable, +} |