static/js/main.js
//Test the ping of the client to server
Test the ping of the client to server
Test the ping of the client to server
async function testPing() {
    var startTime, endTime;
    var result1 = 0;
    var result2 = 0;
    var result3 = 0;
    var result4 = 0;
    var result5 = 0;
    var ping;
    startTime = (new Date()).getTime();
    await doPing();
    endTime = (new Date()).getTime();
    result1 = (endTime - startTime);
    startTime = (new Date()).getTime();
    await doPing();
    endTime = (new Date()).getTime();
    result2 = (endTime - startTime);
    startTime = (new Date()).getTime();
    await doPing();
    endTime = (new Date()).getTime();
    result3 = (endTime - startTime);
    startTime = (new Date()).getTime();
    await doPing();
    endTime = (new Date()).getTime();
    result4 = (endTime - startTime);
    startTime = (new Date()).getTime();
    await doPing();
    endTime = (new Date()).getTime();
    result5 = (endTime - startTime);
    var ping = (result1 + result2 + result3 + result4 + result5) / 5;
    updatePingText(Math.round(ping) + " MS");
    checkJitter(result1, result2, result3, result4, result5);
}
async function testPing ( ) { var startTime , endTime ; var result1 = 0 ; var result2 = 0 ; var result3 = 0 ; var result4 = 0 ; var result5 = 0 ; var ping ; startTime = ( new Date ( ) ) . getTime ( ) ; await doPing ( ) ; endTime = ( new Date ( ) ) . getTime ( ) ; result1 = ( endTime - startTime ) ; startTime = ( new Date ( ) ) . getTime ( ) ; await doPing ( ) ; endTime = ( new Date ( ) ) . getTime ( ) ; result2 = ( endTime - startTime ) ; startTime = ( new Date ( ) ) . getTime ( ) ; await doPing ( ) ; endTime = ( new Date ( ) ) . getTime ( ) ; result3 = ( endTime - startTime ) ; startTime = ( new Date ( ) ) . getTime ( ) ; await doPing ( ) ; endTime = ( new Date ( ) ) . getTime ( ) ; result4 = ( endTime - startTime ) ; startTime = ( new Date ( ) ) . getTime ( ) ; await doPing ( ) ; endTime = ( new Date ( ) ) . getTime ( ) ; result5 = ( endTime - startTime ) ; var ping = ( result1 + result2 + result3 + result4 + result5 ) / 5 ; updatePingText ( Math . round ( ping ) + " MS" ) ; checkJitter ( result1 , result2 , result3 , result4 , result5 ) ; }
Test the ping of the client to server
Test the ping of the client to server