# clearInterval() not working

**URL:** <https://discourse.nodered.org/t/clearinterval-not-working/91169>\
**Category:** Developing Nodes\
**Created:** [21 September 2024 19:30 UTC](https://discourse.nodered.org/t/clearinterval-not-working/91169 "2024-09-21T19:30:07Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)\
**Post date:** [21 September 2024 20:13 UTC](https://discourse.nodered.org/t/clearinterval-not-working/91169/5 "2024-09-21T20:13:47Z")

</div>

Is it because you are not storing the timer handle? see my previous posted example -

> [@clearTimeout not function](https://discourse.nodered.org/t/cleartimeout-not-function/90870/3):
>
> Like this @wilson2517 ... var entrada = msg.payload; var testset = context.get("testset"); // Retrieve the stored timeout reference if (entrada == "on") { testset = setTimeout(function() { msg.payload = "active"; node.send(msg); }, 2000); context.set("testset", testset); // Store the timeout reference for future use } if (entrada == "off") { clearTimeout(testset); // Clear the timeout context.set("testset", null); // Clear the stored timeout reference…

---

_[View the full topic](https://discourse.nodered.org/t/clearinterval-not-working/91169)._
