From bc9971ec7bf2e00178811d3c71812e2124ea4f02 Mon Sep 17 00:00:00 2001 From: ReznoRMichael Date: Sat, 23 Jan 2021 13:58:05 +0100 Subject: [PATCH] Total time --- js/LoadSaveFile.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/js/LoadSaveFile.js b/js/LoadSaveFile.js index 4e720a8..c0d2aca 100644 --- a/js/LoadSaveFile.js +++ b/js/LoadSaveFile.js @@ -24,6 +24,7 @@ let bench = { end: { LSF: 0, HKCC: 0, + total: 0, } }; @@ -34,9 +35,9 @@ let bench = { * Starts benchmarking. * @param {FileList} input FileList object containing a list of File objects. The FileList behaves like an array, so you can check its length property to get the number of selected files. */ -function LoadSaveFile(input) { +function LoadSaveFile(input, startTime = new Date()) { // start benchmark - bench.begin.LSF = new Date(); + bench.begin.LSF = startTime; // Prepares a File object from the first file of the input files for reading as an Array Buffer let inputFileObject = input.files[0]; @@ -95,6 +96,10 @@ function ProcessFileObject() { // after pasting the decoded string, launch the main analyzing function immediately HKReadTextArea(); + // finish total and show benchmark + bench.end.total = new Date(); + console.info("Total time (ms) =", bench.end.total - bench.begin.LSF); + // alert(`Decoded String: ${decodedString}`); // alert(`Array Buffer: ${inputArrayBuffer}`); } catch (error) {