From 6aaac4be18db65599ace7834fd9be7f0cc71ca97 Mon Sep 17 00:00:00 2001 From: Klemek Date: Fri, 14 Mar 2025 10:11:14 +0100 Subject: [PATCH] working poc --- main.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/main.js b/main.js index 246818a..4f5a69c 100644 --- a/main.js +++ b/main.js @@ -25,6 +25,7 @@ const app = createApp({ fileStream: null, fileName: null, fileSize: null, + t0: new Date(), }; }, computed: {}, @@ -76,6 +77,7 @@ const app = createApp({ initConnection(conn) { conn.on("open", () => { console.log("connOpen"); + console.log(conn); this.connection = conn; this.connection.on("close", this.connClose); this.connection.on("error", this.connError); @@ -109,6 +111,7 @@ const app = createApp({ console.log(data.type); switch (data.type) { case "start": + this.t0 = new Date(); this.fileName = data.fileName; this.fileSize = data.fileSize; this.fileStream = streamSaver @@ -126,6 +129,8 @@ const app = createApp({ if (this.fileStream) { this.fileStream.close(); } + console.log(new Date() - this.t0); + console.log(this.fileSize / (new Date() - this.t0)); break; default: break;