]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
workflow: log compile time in template explorer
authorEvan You <yyx990803@gmail.com>
Fri, 7 Feb 2020 02:47:07 +0000 (21:47 -0500)
committerEvan You <yyx990803@gmail.com>
Fri, 7 Feb 2020 02:47:07 +0000 (21:47 -0500)
packages/template-explorer/src/index.ts

index 6fc650fbcb1b7f3ca962cb60c3d2e22d5389d363..b774a7794cd429227378cdc78d2b272c9fb9f439 100644 (file)
@@ -37,6 +37,7 @@ window.init = () => {
     try {
       const errors: CompilerError[] = []
       const compileFn = ssrMode.value ? ssrCompile : compile
+      const start = performance.now()
       const { code, ast, map } = compileFn(source, {
         filename: 'template.vue',
         ...compilerOptions,
@@ -45,6 +46,7 @@ window.init = () => {
           errors.push(err)
         }
       })
+      console.log(`Compiled in ${(performance.now() - start).toFixed(2)}ms.`)
       monaco.editor.setModelMarkers(
         editor.getModel()!,
         `@vue/compiler-dom`,