fix: move a start time indicator closer to the source

This commit is contained in:
CosminPerRam 2024-02-24 18:21:54 +02:00
parent ae02aa79e4
commit ecd1630b11
1 changed files with 1 additions and 2 deletions

View File

@ -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 {