# Calculate percentage between time

**URL:** <https://discourse.nodered.org/t/calculate-percentage-between-time/34448>\
**Category:** General\
**Created:** [18 October 2020 11:50 UTC](https://discourse.nodered.org/t/calculate-percentage-between-time/34448 "2020-10-18T11:50:44Z")\
**Posts on this page:** 1\
**Showing post:** 13

<div class="post-metadata">

**Author:** ![MrWolff](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/mrwolff/32/30557_2.png) [@MrWolff](https://discourse.nodered.org/u/MrWolff)\
**Post date:** [18 October 2020 17:02 UTC](https://discourse.nodered.org/t/calculate-percentage-between-time/34448/13 "2020-10-18T17:02:28Z")

</div>

Thanks Colin!

I spend hours watching node-red Essentials.

I made the runtime msg.runtime  
And the downtime msg.downtime  
In de debug menu I see the values in seconds from msg.runtime and msg.downtime

I made a function node where I want to calculate the uptime by: runtime minus downtime .

Like the example: [Percent calculation](https://discourse.nodered.org/t/percent-calculation/25309/4)

But it doesn't work properly ☹  
I have no idea why. It's driving me crazy! 😤

What am I doing wrong? 🤔

![runtime](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/f/cf5a671a1eb27b881ea39a2ae84092f5d8f0a3d1.png)

---

_[View the full topic](https://discourse.nodered.org/t/calculate-percentage-between-time/34448)._
