Skip to content

Commit

Permalink
chore: log duration of parsing and rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
josdejong committed Apr 8, 2022
1 parent cec7c22 commit fbc7b98
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/routes/development.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
} from '$lib'
import { useLocalStorage } from '$lib/utils/localStorageUtils.js'
import { range } from 'lodash-es'
import { tick } from 'svelte'
let content = {
text: `{
Expand Down Expand Up @@ -310,14 +311,14 @@
reader.onload = function (event) {
console.timeEnd('load file')

console.time('set JSON')
console.time('parse and render')

content = {
text: event.target.result,
json: undefined
}

console.timeEnd('set JSON')
tick().then(() => console.timeEnd('parse and render'))
}
reader.readAsText(file)
}}
Expand Down
6 changes: 4 additions & 2 deletions tools/develop-vanilla.html
Original file line number Diff line number Diff line change
Expand Up @@ -275,9 +275,11 @@
console.timeEnd('load file')
const text = event.target.result

console.time('set JSON')
console.time('parse and render')

testEditor.set({ text })
console.timeEnd('set JSON')

setTimeout(() => console.timeEnd('parse and render'))
}
reader.readAsText(file)
}
Expand Down

0 comments on commit fbc7b98

Please sign in to comment.