mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
return total time from the profile .end() method
This commit is contained in:
parent
41c2bd7fcd
commit
ffea31290c
1 changed files with 9 additions and 8 deletions
|
@ -23,11 +23,12 @@ module.exports = class Profiler
|
|||
|
||||
end: (message) ->
|
||||
totalTime = deltaMs(@t, @t0)
|
||||
return if totalTime < @LOG_CUTOFF_TIME # skip anything less than cutoff
|
||||
args = {}
|
||||
for k,v of @args
|
||||
args[k] = v
|
||||
args.updateTimes = @updateTimes
|
||||
args.start = @start
|
||||
args.end = new Date()
|
||||
logger.log args, @name
|
||||
if totalTime > @LOG_CUTOFF_TIME # log anything greater than cutoff
|
||||
args = {}
|
||||
for k,v of @args
|
||||
args[k] = v
|
||||
args.updateTimes = @updateTimes
|
||||
args.start = @start
|
||||
args.end = new Date()
|
||||
logger.log args, @name
|
||||
return totalTime
|
||||
|
|
Loading…
Reference in a new issue