From d10aa8b11a87f8ad675fc72cac51d3de4943007f Mon Sep 17 00:00:00 2001 From: Ewan Sheldon Date: Mon, 25 Sep 2023 12:12:44 +0200 Subject: [PATCH] record successful data times --- src/transactions.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/transactions.js b/src/transactions.js index a9d8207..6c4c87b 100644 --- a/src/transactions.js +++ b/src/transactions.js @@ -33,8 +33,11 @@ const twoSecTimeout = _ => { const retryableWithTimeout = async promise => { try { + const start = Math.floor(new Date() / 1000); const data = await Promise.race([promise, twoSecTimeout()]); - console.log(data) + const end = Math.floor(new Date() / 1000); + console.log(`data fetched (${end - start}s)`); + console.log() return data; } catch (e) { console.log(e)