From ae5fbfd31524a5afd4d0faca58650797cbf3025f Mon Sep 17 00:00:00 2001 From: Marco Munizaga Date: Tue, 28 Feb 2023 21:24:19 -0800 Subject: [PATCH] Fix arithmetic --- src/perf/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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) } }