🎈 perf: 更新引入

This commit is contained in:
m1m1sha
2024-05-05 23:14:22 +08:00
parent 740d2938f5
commit 584d924433
3 changed files with 259 additions and 10 deletions

View File

@@ -1,8 +1,4 @@
<script setup lang="ts">
import { ref, computed, onMounted, onUnmounted } from 'vue'
import { useNetworkStore } from '../main';
const networkStore = useNetworkStore();
const props = defineProps<{
@@ -230,7 +226,7 @@ let prevRxSum = 0;
let txRate = ref('0');
let rxRate = ref('0');
onMounted(() => {
rateIntervalId = setInterval(() => {
rateIntervalId = window.setInterval(() => {
let curTxSum = txGlobalSum();
txRate.value = humanFileSize((curTxSum - prevTxSum) / (rateInterval / 1000));
prevTxSum = curTxSum;