        window.clearTimeout(timerId)
        timerId = null
      }
      if (rafId !== null) {
        window.cancelAnimationFrame(rafId)
        rafId = null
      }
    }
    onMounted(() => {
      watchEffect(() => {
        if (props.active) {
          pnow = performance.now()
          frame()
        } else {
          const now = performance.now()