diff --git a/src/assets/HestiaClasses.js b/src/assets/HestiaClasses.js index 86520c3..968e29d 100644 --- a/src/assets/HestiaClasses.js +++ b/src/assets/HestiaClasses.js @@ -86,7 +86,10 @@ export class Communicator { const msgStr = message.toString(); const msgJson = JSON.parse(msgStr); console.log(`Message received on topic ${topic}: ${msgStr}`); - if (msgJson.timestamp) console.log(`Timestamp: ${msgJson.timestamp}`); + if (msgJson.timestamp) { + const age = Date.now() - msgJson.timestamp; + console.log(`Message age: ${age / 1000}s`); + } console.log(msgJson); state[msgJson.name].on = msgJson.on; if (msgJson.feedRate) state[msgJson.name].feedRate = msgJson.feedRate;