fix: move a start time indicator closer to the source
This commit is contained in:
parent
ae02aa79e4
commit
ecd1630b11
|
@ -102,10 +102,9 @@ export default class Core extends EventEmitter {
|
||||||
|
|
||||||
/** Param can be a time in ms, or a promise (which will be timed) */
|
/** Param can be a time in ms, or a promise (which will be timed) */
|
||||||
async registerRtt (param) {
|
async registerRtt (param) {
|
||||||
const start = Date.now()
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (param instanceof Promise) {
|
if (param instanceof Promise) {
|
||||||
|
const start = Date.now()
|
||||||
await param
|
await param
|
||||||
await this.registerRtt(Date.now() - start)
|
await this.registerRtt(Date.now() - start)
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue