Here is a function to calculate the time difference between successive message timestamps.
If the message sent at the trigger temperature does not contain a timestamp, you would have to generate one in the function.
[{"id":"9648da80c2c77166","type":"inject","z":"ac3483be8df714b3","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":220,"y":120,"wires":[["28c953b77c5bcf93"]]},{"id":"28c953b77c5bcf93","type":"function","z":"ac3483be8df714b3","name":"function 1","func":"function timeDifference(ts1, ts2) {\n var millisec = ts1 - ts2;\n const days = Math.floor(millisec / 1000 / 60 / 60 / 24);\n millisec -= days * 1000 * 60 * 60 * 24\n const hrs = Math.floor(millisec / 1000 / 60 / 60);\n millisec -= hrs * 1000 * 60 * 60\n const mins = Math.floor(millisec / 1000 / 60);\n millisec -= mins * 1000 * 60\n const secs = Math.floor(millisec / 1000);\n millisec -= secs * 1000\n return { \"days\": days, \"hrs\": hrs, \"mins\": mins, \"secs\": secs, \"ms\": millisec }\n}\n\nconst previous = flow.get(\"lasttimestamp\") ?? 0\n\nif (previous == 0) { \n flow.set(\"lasttimestamp\", msg.payload) \n msg.payload = \"Waiting for second timestamp\"\n}\nelse {\n flow.set(\"lasttimestamp\", msg.payload)\n msg.payload = timeDifference(msg.payload, previous)\n}\nreturn msg;\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":380,"y":120,"wires":[["a0d70c27a8570170"]]},{"id":"a0d70c27a8570170","type":"debug","z":"ac3483be8df714b3","name":"debug 5","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":540,"y":120,"wires":[]}]
{"days":0,"hrs":0,"mins":2,"secs":55,"ms":575}