mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-26 06:01:54 +00:00
Clean up, don't allocate an extra date
This commit is contained in:
parent
5ea83947dd
commit
f397678589
1 changed files with 1 additions and 3 deletions
|
@ -17,11 +17,9 @@ module.exports = (obj, methodName, key, logger) ->
|
|||
)
|
||||
|
||||
timer = new metrics.Timer(key)
|
||||
start = new Date()
|
||||
|
||||
realMethod.call this, firstArgs..., (callbackArgs...) ->
|
||||
timer.done()
|
||||
elapsedTime = new Date() - start
|
||||
elapsedTime = timer.done()
|
||||
if logger?
|
||||
logger.log {key, elapsedTime}, "[Metrics] timed async method call"
|
||||
callback.apply this, callbackArgs
|
||||
|
|
Loading…
Reference in a new issue