Skip to content

Commit

Permalink
record successful data times
Browse files Browse the repository at this point in the history
  • Loading branch information
ewansheldon committed Sep 25, 2023
1 parent d89cbb1 commit d10aa8b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/transactions.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit d10aa8b

Please sign in to comment.