From d0ae3234d5e50d5ed97e808fc27f6f0f3050fb68 Mon Sep 17 00:00:00 2001 From: Sam Carlton Date: Tue, 1 Dec 2020 16:16:18 -0600 Subject: [PATCH] Measure list building and reading time --- nuxt.config.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/nuxt.config.js b/nuxt.config.js index d4134be..9e7140c 100644 --- a/nuxt.config.js +++ b/nuxt.config.js @@ -31,6 +31,9 @@ const storeAppLists = async function (builder) { const savedLists = await Promise.all(listsOptions.map(async list => { + const methodName = `Building ${list.path}` + console.time(methodName) + // Run the build method const builtList = await list.buildMethod() @@ -49,6 +52,9 @@ const storeAppLists = async function (builder) { const savedList = JSON.parse(savedListJSON) + + console.timeEnd(methodName) + // Import the created JSON File return savedList })) @@ -84,6 +90,9 @@ export default { }, routes() { return Promise.all(listsOptions.map(async list => { + const methodName = `Reading ${list.path}` + console.time(methodName) + const listPath = `.${list.path}` // Read JSON to ensure it exists @@ -92,6 +101,8 @@ export default { // Parse the saved JSON into a variable const savedList = JSON.parse(savedListJSON) + console.timeEnd(methodName) + // Pass on the variable return savedList }))