Add latency measurement to lib/ping.js