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

Merge pull request #63 from robonen/feat/sync-mutex

fix(packages/stdlib): add SyncMutex primitive
This commit is contained in:
2025-05-09 13:19:14 +07:00
committed by GitHub
7 changed files with 221 additions and 3 deletions

View File

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