src=http://cdn.pubnub.com/pubnub-3.1.js></script>
<script>(function(){

    // Copy this Code to Check Latency
    function now(){return+new Date}
    function connection_latency(callback) {
        connection_latency.start = now();

        PUBNUB.time(function(){
            callback(now() - connection_latency.start);
            setTimeout( function(){ connection_latency(callback) }, 1000 );
            clearInterval(connection_latency.ival);
            connection_latency.ival = 0;
        });

        