mirror of
https://github.com/overleaf/overleaf.git
synced 2025-04-27 07:24:02 +00: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) ->
|
end: (message) ->
|
||||||
totalTime = deltaMs(@t, @t0)
|
totalTime = deltaMs(@t, @t0)
|
||||||
return if totalTime < @LOG_CUTOFF_TIME # skip anything less than cutoff
|
if totalTime > @LOG_CUTOFF_TIME # log anything greater than cutoff
|
||||||
args = {}
|
args = {}
|
||||||
for k,v of @args
|
for k,v of @args
|
||||||
args[k] = v
|
args[k] = v
|
||||||
args.updateTimes = @updateTimes
|
args.updateTimes = @updateTimes
|
||||||
args.start = @start
|
args.start = @start
|
||||||
args.end = new Date()
|
args.end = new Date()
|
||||||
logger.log args, @name
|
logger.log args, @name
|
||||||
|
return totalTime
|
||||||
|
|
Loading…
Add table
Reference in a new issue