From 2cf975b9f67cf4fec0c85de2651e37385c21d10e Mon Sep 17 00:00:00 2001 From: mmorrison Date: Wed, 31 Jan 2018 00:34:11 -0600 Subject: [PATCH] Add query duration Fixes #76 --- protocols/core.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/protocols/core.js b/protocols/core.js index 7a733a4..86e5966 100644 --- a/protocols/core.js +++ b/protocols/core.js @@ -71,6 +71,8 @@ class Core extends EventEmitter { state.query.type = this.type; if('pretty' in this) state.query.pretty = this.pretty; + state.duration = Date.now() - this.startMillis; + this.reset(); this.finished = true; this.emit('finished',state); @@ -98,6 +100,8 @@ class Core extends EventEmitter { const options = this.options; this.reset(); + this.startMillis = Date.now(); + async.series([ (c) => { // resolve host names