diff --git a/src/views/mqtt/index.vue b/src/views/mqtt/index.vue
index c1aab69..ff75ab0 100644
--- a/src/views/mqtt/index.vue
+++ b/src/views/mqtt/index.vue
@@ -30,6 +30,7 @@ const publish = reactive({
lastRawTimestamp: 0,
timeOffset: 0,
timeTicking: 1,
+ performance: 0,
onlineCars: 0,
percentage: 0,
pause: false,
@@ -110,6 +111,7 @@ async function doPublish() {
}
// if (publishing.pause) return
publish.lastTime = Date.now()
+ const perStartTime = performance.now()
let item = next()
// 判断下有没有内容,防止空指针
@@ -138,6 +140,8 @@ async function doPublish() {
const json = JSON.stringify(item)
mqttClient!.publish(topic, json, {})
+
+ publish.performance = performance.now() - perStartTime
}, 100)
}
@@ -217,7 +221,30 @@ function reverse() {
{{ publish.onlineCars }}
-