diff --git a/src/js/ConfigInserter.js b/src/js/ConfigInserter.js index 58e812e6..c77c53e1 100644 --- a/src/js/ConfigInserter.js +++ b/src/js/ConfigInserter.js @@ -86,8 +86,10 @@ function generateData(firmware, input, startAddress) { firmware.bytes_total += input.length; } +const CONFIG_LABEL = `Custom defaults inserted in`; + ConfigInserter.prototype.insertConfig = function (firmware, input) { - const timeParsingStart = microtime(); // track time + console.time(CONFIG_LABEL); const customDefaultsArea = getCustomDefaultsArea(firmware); @@ -99,7 +101,7 @@ ConfigInserter.prototype.insertConfig = function (firmware, input) { generateData(firmware, input, customDefaultsArea.startAddress); - console.log(`Custom defaults inserted in: ${microtime() - timeParsingStart.toFixed(4)} seconds.`); + console.timeEnd(CONFIG_LABEL); return true; } diff --git a/src/js/utils/common.js b/src/js/utils/common.js index 006a0991..a6fbfc4e 100644 --- a/src/js/utils/common.js +++ b/src/js/utils/common.js @@ -1,9 +1,5 @@ import semver from "semver"; -export function microtime() { - return new Date().getTime() / 1000; -} - export function millitime() { return new Date().getTime(); } @@ -85,3 +81,4 @@ window.degToRad = degToRad; window.bytesToSize = bytesToSize; window.checkChromeRuntimeError = checkChromeRuntimeError; window.generateVirtualApiVersions = generateVirtualApiVersions; +window.millitime = millitime; diff --git a/src/js/workers/hex_parser.js b/src/js/workers/hex_parser.js index 19bb501b..f0370f45 100644 --- a/src/js/workers/hex_parser.js +++ b/src/js/workers/hex_parser.js @@ -96,7 +96,7 @@ function read_hex_file(data) { const TIME_LABEL = 'HEX_PARSER - File parsed in'; onmessage = function(event) { - console.time(TIME_LABEL) + console.time(TIME_LABEL); read_hex_file(event.data);