logarithmic graph

This commit is contained in:
2024-12-03 23:06:47 -08:00
parent 1fb3ef02db
commit 07b585f956
16 changed files with 758 additions and 554 deletions

View File

@@ -1,19 +1,19 @@
import { onMounted, onUnmounted, ref, shallowRef } from 'vue'
export function useNow(update_ms: number) {
const handle = shallowRef<number | undefined>(undefined);
const now = ref(Date.now());
const handle = shallowRef<number | undefined>(undefined)
const now = ref(Date.now())
onMounted(() => {
handle.value = setInterval(() => {
now.value = Date.now();
}, update_ms);
});
onUnmounted(() => {
if (handle.value) {
clearInterval(handle.value);
}
});
onMounted(() => {
handle.value = setInterval(() => {
now.value = Date.now()
}, update_ms)
})
onUnmounted(() => {
if (handle.value) {
clearInterval(handle.value)
}
})
return now;
return now
}