summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2017-01-13 00:20:10 +0800
committerruki <[email protected]>2017-01-13 00:20:10 +0800
commit84d5470a4143f497ec0242c60fbeff9d0800afaf (patch)
tree7886d73e94472d5f5911d2029e6a40e1161b83ee
parentc7629787087e6428e42884f57762f30a5d3ae683 (diff)
fix profiler bug
-rw-r--r--xmake/core/base/profiler.lua3
1 files changed, 2 insertions, 1 deletions
diff --git a/xmake/core/base/profiler.lua b/xmake/core/base/profiler.lua
index 480e3fc75..e8aeab18c 100644
--- a/xmake/core/base/profiler.lua
+++ b/xmake/core/base/profiler.lua
@@ -107,8 +107,9 @@ function profiler:_profiling_return(funcinfo)
assert(report)
-- update the total time
- if report.calltime then
+ if report.calltime and report.calltime > 0 then
report.totaltime = report.totaltime + (stoptime - report.calltime)
+ report.calltime = 0
end
end