<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">function jsSpeed(domain,callBack){
    let alltime = []
    $.ping = function(url)
    {
        var ping, requestTime, responseTime ;
        $.ajax({
            url: url,  //è®¾ç½®ä¸€ä¸ªç©ºçš„ajaxè¯·æ±‚
            type: 'GET',
            dataType: 'jsonp',
            timeout: 10000,
            beforeSend : function()
            {
                requestTime = new Date().getTime();
            },
            complete : function(e)
            {
                responseTime = new Date().getTime();
                ping = Math.abs(requestTime - responseTime);
                if(e.status!=200){
                    ping=10001;
                }
                alltime.push({
                    url:url,
                    ping:ping
                });
                if(alltime.length==domain.length){
                    if(callBack){
                        callBack(alltime)
                    }
                }
            }
        });
    };
    for(let d of domain){
        $.ping(d);
    }
}
</pre></body></html>