MCPcopy
hub / github.com/openspeedtest/Speed-Test / OpenSpeedtest

Function OpenSpeedtest

assets/js/app-2.5.4.js:893–1032  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

891 OpenSpeedtest();
892 }
893 function OpenSpeedtest() {
894 if (openChannel === "widget" || openChannel === "web") {
895 ServerConnect(1);
896 }
897 function readyToUP() {
898 uploadTime = window.performance.now();
899 upReq();
900 }
901 var Engine = setInterval(function() {
902 if (Status === "Loaded") {
903 Status = "busy";
904 sendPing(0);
905 }
906 if (Status === "Ping") {
907 Status = "busy";
908 Show.showStatus("Milliseconds");
909 }
910 if (Status === "Download") {
911 Show.showStatus("Initializing..");
912 Get.reset();
913 reSett();
914 Show.reset();
915 downloadTime = window.performance.now();
916 downReq();
917 Status = "initDown";
918 }
919 if (Status === "Downloading") {
920 Show.Symbol(0);
921 if (Startit == 0) {
922 Startit = 1;
923 Show.showStatus("Testing download speed..");
924 var extraTime = (window.performance.now() - downloadTime) / 1000;
925 dReset = extraTime;
926 Show.progress(1, dlDuration + 2.5);
927 dlDuration += extraTime;
928 }
929 downloadTimeing = (window.performance.now() - downloadTime) / 1000;
930 reportCurrentSpeed("dl");
931 Show.showStatus("Mbps download");
932 Show.mainGaugeProgress(currentSpeed);
933 Show.LiveSpeed(currentSpeed);
934 Show.Graph(currentSpeed, 0);
935 downloadSpeed = Get.AvgSpeed(currentSpeed, dlFinal, dlDuration);
936 if (downloadTimeing >= dlDuration && ProG == "done") {
937 if (SelectTest) {
938 Show.GaugeProgresstoZero(currentSpeed, "SendR");
939 Show.showStatus("All done");
940 Show.Symbol(2);
941 } else {
942 Show.GaugeProgresstoZero(currentSpeed, "Upload");
943 }
944 Show.downloadResult(downloadSpeed);
945 dataUsedfordl = dLoaded;
946 stop = 1;
947 Status = "busy";
948 reSett();
949 Get.reset();
950 }

Callers 1

testRunFunction · 0.85

Calls 5

ServerConnectFunction · 0.85
sendPingFunction · 0.85
reSettFunction · 0.85
downReqFunction · 0.85
reportCurrentSpeedFunction · 0.85

Tested by

no test coverage detected