mirror of
https://github.com/danbulant/node-x11
synced 2026-06-09 17:52:36 +00:00
return roundtrip time in ping() callback
This commit is contained in:
parent
f3681b9aa2
commit
8e1f501701
1 changed files with 2 additions and 1 deletions
|
|
@ -87,9 +87,10 @@ XClient.prototype.terminate = function()
|
||||||
// GetAtomName used as cheapest non-modifying request with reply
|
// GetAtomName used as cheapest non-modifying request with reply
|
||||||
// 3 - id for shortest standard atom, "ARC"
|
// 3 - id for shortest standard atom, "ARC"
|
||||||
XClient.prototype.ping = function(cb) {
|
XClient.prototype.ping = function(cb) {
|
||||||
|
var start = Date.now();
|
||||||
this.GetAtomName(3, function(err, str) {
|
this.GetAtomName(3, function(err, str) {
|
||||||
if (err) return cb(err);
|
if (err) return cb(err);
|
||||||
return cb();
|
return cb(null, Date.now() - start);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue