fix small bug that made the latency be NaN sometimes

This commit is contained in:
Romain Beaumont 2016-01-04 20:44:28 +01:00
parent 78c3820de0
commit dd06a7075e

View File

@ -74,7 +74,7 @@ function createServer(options) {
}
function onKeepAlive() {
client.latency = (new Date()) - sendKeepAliveTime;
if(sendKeepAliveTime) client.latency = (new Date()) - sendKeepAliveTime;
lastKeepAlive = new Date();
}