From 8e1f501701ad77fdd34489868694f0ca261c371c Mon Sep 17 00:00:00 2001 From: Andrey Sidorov Date: Tue, 17 Jul 2012 01:21:28 +1000 Subject: [PATCH] return roundtrip time in ping() callback --- lib/x11/xcore.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/x11/xcore.js b/lib/x11/xcore.js index 28cd9a6..b3c476d 100644 --- a/lib/x11/xcore.js +++ b/lib/x11/xcore.js @@ -87,9 +87,10 @@ XClient.prototype.terminate = function() // GetAtomName used as cheapest non-modifying request with reply // 3 - id for shortest standard atom, "ARC" XClient.prototype.ping = function(cb) { + var start = Date.now(); this.GetAtomName(3, function(err, str) { if (err) return cb(err); - return cb(); + return cb(null, Date.now() - start); }); }