how to Ping Google.com

i want to check internet speed to google, then how to get return value of ping time?
i can’t figure out the syntax so i tried :

function  Update(){
Debug.Log(Ping("www.google.com").time);}

but debug always return -1, please give me help of sample script…

The correct usage of 'Ping' is asynchronous- what you're trying to do here is start a fresh Ping every frame, without waiting for it to return anything!

Instead, use it like this:

function Start()
{
    PingGoogle();
}

function PingGoogle()
{
    var googPing : Ping = new Ping("74.125.224.72");
    // keep in mind that 'Ping' only accepts IP addresses, it doesn't 
    // do DNS lookup. This address may not work for your location-
    // Google owns many servers the world over.

    while(!googPing.isDone)
    {
        yield;
    }
    Debug.Log(googPing.time);
}