1
0
mirror of https://github.com/robonen/tools.git synced 2026-03-20 10:54:44 +00:00

chore(packages/vue): rename startTime to renderStartTime in useRenderInfo

This commit is contained in:
2025-05-09 13:18:12 +07:00
parent 4ead7fb18c
commit c7048be9fb

View File

@@ -22,12 +22,12 @@ import { getLifeCycleTarger } from '../..';
export function useRenderInfo(instance?: ComponentInternalInstance) { export function useRenderInfo(instance?: ComponentInternalInstance) {
const target = getLifeCycleTarger(instance); const target = getLifeCycleTarger(instance);
const duration = ref(0); const duration = ref(0);
let startTime = 0; let renderStartTime = 0;
const startMark = () => startTime = performance.now(); const startMark = () => renderStartTime = performance.now();
const endMark = () => { const endMark = () => {
duration.value = Math.max(performance.now() - startTime, 0); duration.value = Math.max(performance.now() - renderStartTime, 0);
startTime = 0; renderStartTime = 0;
}; };
onBeforeMount(startMark, target); onBeforeMount(startMark, target);