mirror of
https://github.com/ThatGuySam/doesitarm.git
synced 2026-05-18 06:44:46 -07:00
Measure list building and reading time
This commit is contained in:
parent
8d22db38bf
commit
d0ae3234d5
1 changed files with 11 additions and 0 deletions
|
|
@ -31,6 +31,9 @@ const storeAppLists = async function (builder) {
|
||||||
|
|
||||||
const savedLists = await Promise.all(listsOptions.map(async list => {
|
const savedLists = await Promise.all(listsOptions.map(async list => {
|
||||||
|
|
||||||
|
const methodName = `Building ${list.path}`
|
||||||
|
console.time(methodName)
|
||||||
|
|
||||||
// Run the build method
|
// Run the build method
|
||||||
const builtList = await list.buildMethod()
|
const builtList = await list.buildMethod()
|
||||||
|
|
||||||
|
|
@ -49,6 +52,9 @@ const storeAppLists = async function (builder) {
|
||||||
|
|
||||||
const savedList = JSON.parse(savedListJSON)
|
const savedList = JSON.parse(savedListJSON)
|
||||||
|
|
||||||
|
|
||||||
|
console.timeEnd(methodName)
|
||||||
|
|
||||||
// Import the created JSON File
|
// Import the created JSON File
|
||||||
return savedList
|
return savedList
|
||||||
}))
|
}))
|
||||||
|
|
@ -84,6 +90,9 @@ export default {
|
||||||
},
|
},
|
||||||
routes() {
|
routes() {
|
||||||
return Promise.all(listsOptions.map(async list => {
|
return Promise.all(listsOptions.map(async list => {
|
||||||
|
const methodName = `Reading ${list.path}`
|
||||||
|
console.time(methodName)
|
||||||
|
|
||||||
const listPath = `.${list.path}`
|
const listPath = `.${list.path}`
|
||||||
|
|
||||||
// Read JSON to ensure it exists
|
// Read JSON to ensure it exists
|
||||||
|
|
@ -92,6 +101,8 @@ export default {
|
||||||
// Parse the saved JSON into a variable
|
// Parse the saved JSON into a variable
|
||||||
const savedList = JSON.parse(savedListJSON)
|
const savedList = JSON.parse(savedListJSON)
|
||||||
|
|
||||||
|
console.timeEnd(methodName)
|
||||||
|
|
||||||
// Pass on the variable
|
// Pass on the variable
|
||||||
return savedList
|
return savedList
|
||||||
}))
|
}))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue