diff --git a/src/perf/index.ts b/src/perf/index.ts index bb5d4aba2d..e6c43035bf 100644 --- a/src/perf/index.ts +++ b/src/perf/index.ts @@ -121,13 +121,13 @@ export class PerfService implements Startable { async measureDownloadBandwidth (peer: PeerId, size: bigint) { const now = Date.now() await this.startPerfOnStream(peer, 0n, size) - return (8n * size) / BigInt((Date.now() - now) / 1000) + return (8000n * size) / BigInt(Date.now() - now) } // measureUploadBandwidth returns the measured bandwidth in bit per second async measureUploadBandwidth (peer: PeerId, size: bigint) { const now = Date.now() await this.startPerfOnStream(peer, size, 0n) - return (8n * size) / BigInt((Date.now() - now) / 1000) + return (8000n * size) / BigInt(Date.now() - now) } }