round port resonse time
This commit is contained in:
1 parent
5d825537ae
commit
1683c2980e
1 file changed
+3
-3
@@ -250,7 +250,7 @@ class NetworkService implements INetworkService {
|
|||||||
|
|
||||||
socket.on("connect", () => {
|
socket.on("connect", () => {
|
||||||
socket.destroy();
|
socket.destroy();
|
||||||
const duration = performance.now() - start;
|
const duration = Math.round(performance.now() - start);
|
||||||
resolve({
|
resolve({
|
||||||
status: "up",
|
status: "up",
|
||||||
responseTime: duration,
|
responseTime: duration,
|
||||||
@@ -260,7 +260,7 @@ class NetworkService implements INetworkService {
|
|||||||
|
|
||||||
socket.on("error", (err) => {
|
socket.on("error", (err) => {
|
||||||
socket.destroy();
|
socket.destroy();
|
||||||
const duration = performance.now() - start;
|
const duration = Math.round(performance.now() - start);
|
||||||
resolve({
|
resolve({
|
||||||
status: "down",
|
status: "down",
|
||||||
responseTime: duration,
|
responseTime: duration,
|
||||||
@@ -270,7 +270,7 @@ class NetworkService implements INetworkService {
|
|||||||
|
|
||||||
socket.on("timeout", () => {
|
socket.on("timeout", () => {
|
||||||
socket.destroy();
|
socket.destroy();
|
||||||
const duration = performance.now() - start;
|
const duration = Math.round(performance.now() - start);
|
||||||
resolve({
|
resolve({
|
||||||
status: "down",
|
status: "down",
|
||||||
responseTime: duration,
|
responseTime: duration,
|
||||||
|
|||||||
Reference in new issue
Block a user