This is great, very close approximation to actual latency. We had a similar need on our cloud speedtest http://cloudharmony.com/speedtest and implemented using a Java applet that executed and screenscraped an OS ping to capture latency. We've been wanting to replace this with a less intrusive javascript approach.