# How to both reset & set delay in "delay node"

**URL:** https://discourse.nodered.org/t/how-to-both-reset-set-delay-in-delay-node/14999
**Category:** General
**Created:** [1 September 2019 12:43 UTC](https://discourse.nodered.org/t/how-to-both-reset-set-delay-in-delay-node/14999 "2019-09-01T12:43:17Z")
**Posts on this page:** 1
**Showing post:** 3

<div class="post-metadata">

### Author: ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)
#### Post date: [1 September 2019 13:53 UTC](https://discourse.nodered.org/t/how-to-both-reset-set-delay-in-delay-node/14999/3 "2019-09-01T13:53:12Z")

</div>

Actually a simple function node can return two messages...

eg

```auto
msg.delay = 5000;
var m1 = {reset:true};
return [[m1,msg]];

```

```auto
[{"id":"f8275102.af47b","type":"inject","z":"a68cca8a.e5ba98","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":160,"y":1560,"wires":[["193bbb8c.ee43a4"]]},{"id":"193bbb8c.ee43a4","type":"function","z":"a68cca8a.e5ba98","name":"","func":"msg.delay = 5000;\nvar m1 = {reset:true};\nreturn [[m1,msg]];","outputs":1,"noerr":0,"x":320,"y":1560,"wires":[["941932e.e9abcd"]]},{"id":"941932e.e9abcd","type":"delay","z":"a68cca8a.e5ba98","name":"","pauseType":"delay","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":480,"y":1560,"wires":[["d02fef04.15e29"]]},{"id":"d02fef04.15e29","type":"debug","z":"a68cca8a.e5ba98","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":650,"y":1560,"wires":[]}]

```

---

_[View the full topic](https://discourse.nodered.org/t/how-to-both-reset-set-delay-in-delay-node/14999)._
