1
0
Fork 0
mirror of https://github.com/betaflight/betaflight-configurator.git synced 2025-07-23 16:25:22 +03:00

feat: use console.time for timing

This commit is contained in:
Tomas Chmelevskij 2021-02-08 18:25:12 +01:00
parent dfbd46c6f1
commit cb0d9f3a66

View file

@ -93,13 +93,14 @@ function read_hex_file(data) {
} }
} }
const TIME_LABEL = 'HEX_PARSER - File parsed in';
onmessage = function(event) { onmessage = function(event) {
const timeParsingStart = microtime(); // track time console.time(TIME_LABEL)
read_hex_file(event.data); read_hex_file(event.data);
console.log(`HEX_PARSER - File parsed in: ${(microtime() - timeParsingStart).toFixed(4)} seconds`);
// terminate worker // terminate worker
console.timeEnd(TIME_LABEL);
close(); close();
}; };