aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2021-05-22 14:50:52 -0400
committerGitHub <noreply@github.com>2021-05-22 14:50:52 -0400
commitc95827ae6803a38c9b2d8e32f88aabc5dd5de927 (patch)
tree2f57d18d7f85543683823332928ac40fa0bc3f0f
parent1096bbfa33a4af53ae2bfeee459c313fddb7c20d (diff)
Add timing information to dictionary-validate.js (#1694)
-rw-r--r--dev/dictionary-validate.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/dev/dictionary-validate.js b/dev/dictionary-validate.js
index fbb22cfc..29f2eae4 100644
--- a/dev/dictionary-validate.js
+++ b/dev/dictionary-validate.js
@@ -17,6 +17,7 @@
const fs = require('fs');
const path = require('path');
+const {performance} = require('perf_hooks');
const {JSZip} = require('./util');
const {VM} = require('./vm');
@@ -96,13 +97,17 @@ async function main() {
const schemas = getSchemas();
for (const dictionaryFileName of dictionaryFileNames) {
+ const start = performance.now();
try {
console.log(`Validating ${dictionaryFileName}...`);
const source = fs.readFileSync(dictionaryFileName);
const archive = await JSZip.loadAsync(source);
await validateDictionary(archive, schemas);
- console.log('No issues found');
+ const end = performance.now();
+ console.log(`No issues detected (${((end - start) / 1000).toFixed(2)}s)`);
} catch (e) {
+ const end = performance.now();
+ console.log(`Encountered an error (${((end - start) / 1000).toFixed(2)}s)`);
console.warn(e);
}
}