This commit is contained in:
Aakansha Doshi 2021-02-07 20:03:37 +05:30
parent 69a1b74e05
commit 63af29d345
7 changed files with 101 additions and 17 deletions

View file

@ -59,9 +59,8 @@ export const simulatePing = async () => {
method: "HEAD",
});
const endTime = new Date().getTime();
const delay = endTime - startTime;
return delay < 1000 ? `${delay} ms` : `${(delay / 1000).toFixed(1)} s`;
return endTime - startTime;
} catch (e) {
return "Error!";
return -1;
}
};