From ecd1630b114d6fe7e07d1413441f9f07ab0b206b Mon Sep 17 00:00:00 2001 From: CosminPerRam Date: Sat, 24 Feb 2024 18:21:54 +0200 Subject: [PATCH] fix: move a start time indicator closer to the source --- protocols/core.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/protocols/core.js b/protocols/core.js index a84fb66..033e5c2 100644 --- a/protocols/core.js +++ b/protocols/core.js @@ -102,10 +102,9 @@ export default class Core extends EventEmitter { /** Param can be a time in ms, or a promise (which will be timed) */ async registerRtt (param) { - const start = Date.now() - try { if (param instanceof Promise) { + const start = Date.now() await param await this.registerRtt(Date.now() - start) } else {