Chron's avatar
Level 7

How to test performance in Vue?

I'm trying to test the performance of a code block. I don't know if this is the "right way" of doing it.

var start;

const alert = computed(() => {
   start = performance.now()
   const test = {
      alertClass: props.alertClass,
   }
   return test
})

onMounted(() => {
   console.log(alert.value)
   var end = performance.now()
   console.log(end - start)
})
0 likes
1 reply

Please or to participate in this conversation.