From f397678589d97d112e8863c8da81770fa27e45b7 Mon Sep 17 00:00:00 2001 From: Shane Kilkelly Date: Thu, 16 Mar 2017 15:07:25 +0000 Subject: [PATCH] Clean up, don't allocate an extra date --- libraries/metrics/timeAsyncMethod.coffee | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/libraries/metrics/timeAsyncMethod.coffee b/libraries/metrics/timeAsyncMethod.coffee index 7b97c54af8..0b604c3683 100644 --- a/libraries/metrics/timeAsyncMethod.coffee +++ b/libraries/metrics/timeAsyncMethod.coffee @@ -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