New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: use console.time
for timing
#2408
Conversation
4358961
to
689dbe9
Compare
yes, works again ... thx 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The microtime function is only used twice. One where you have fixed with this, the other here:
betaflight-configurator/src/js/ConfigInserter.js
Lines 89 to 105 in 4be400a
ConfigInserter.prototype.insertConfig = function (firmware, input) { | |
const timeParsingStart = microtime(); // track time | |
const customDefaultsArea = getCustomDefaultsArea(firmware); | |
if (!customDefaultsArea || customDefaultsArea.endAddress - customDefaultsArea.startAddress === 0) { | |
return false; | |
} else if (input.length >= customDefaultsArea.endAddress - customDefaultsArea.startAddress) { | |
throw new Error(`Custom defaults area too small (${customDefaultsArea.endAddress - customDefaultsArea.startAddress} bytes), ${input.length + 1} bytes needed.`); | |
} | |
generateData(firmware, input, customDefaultsArea.startAddress); | |
console.log(`Custom defaults inserted in: ${microtime() - timeParsingStart.toFixed(4)} seconds.`); | |
return true; | |
} |
I think is better to remove the function at all and fix the problem in both places.
fixes the issue for me too |
d0def14
to
f22c625
Compare
f22c625
to
59363c4
Compare
Remove `microtime` and console log in favour of `console.time`
59363c4
to
934e648
Compare
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
Fixes #2406
@McGiverGim used
console.time
stuff.@TheIsotopes could you verify it works?