Fixed the example to work with 0ms latencies

The statement if($latency) would return false if the latency is 0ms. This could be the case when pinging localhost or a host on your LAN. By changing it to if($latency !== false) this is no longer the case.