(start: number, conn?: Connection)
| 515 | } |
| 516 | |
| 517 | private measureAndReschedule(start: number, conn?: Connection) { |
| 518 | if (this.closed) { |
| 519 | conn?.destroy(); |
| 520 | return; |
| 521 | } |
| 522 | |
| 523 | if (this.connection == null) { |
| 524 | this.connection = conn; |
| 525 | } |
| 526 | |
| 527 | this.latestRtt = calculateDurationInMs(start); |
| 528 | this.monitorId = setTimeout( |
| 529 | () => this.measureRoundTripTime(), |
| 530 | this.monitor.options.heartbeatFrequencyMS |
| 531 | ); |
| 532 | } |
| 533 | |
| 534 | private measureRoundTripTime() { |
| 535 | const start = processTimeMS(); |
no test coverage detected