summaryrefslogtreecommitdiff
path: root/xmake/core/main.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2021-05-04 00:27:07 +0800
committerruki <[email protected]>2021-05-04 00:27:07 +0800
commit9016206b87381de0eb68f857a52bb910e9c077d0 (patch)
tree85dbc0df289ff1304ef04769ada2acf220dfcd0c /xmake/core/main.lua
parent9fcc366603c2572eb2710b843d240b0368f32ad5 (diff)
improve profiler
Diffstat (limited to 'xmake/core/main.lua')
-rw-r--r--xmake/core/main.lua10
1 files changed, 4 insertions, 6 deletions
diff --git a/xmake/core/main.lua b/xmake/core/main.lua
index a399ffccc..bdea1ab2e 100644
--- a/xmake/core/main.lua
+++ b/xmake/core/main.lua
@@ -38,6 +38,7 @@ local theme = require("theme/theme")
local config = require("project/config")
local project = require("project/project")
local localcache = require("cache/localcache")
+local profiler = require("base/profiler")
-- init the option menu
local menu =
@@ -240,11 +241,8 @@ Or you can add `--root` option or XMAKE_ROOT=y to allow run as root temporarily.
end
-- start profiling
- local profiler
- local profile_mode = os.getenv("XMAKE_PROFILE")
- if profile_mode then
- profiler = require("base/profiler")
- profiler:start(profile_mode)
+ if profiler:enabled() then
+ profiler:start()
end
-- show help?
@@ -285,7 +283,7 @@ Or you can add `--root` option or XMAKE_ROOT=y to allow run as root temporarily.
end
-- stop profiling
- if profiler then
+ if profiler:enabled() then
profiler:stop()
end