# Dynamic Delay Timer in Gateway Event Scripts

**URL:** <https://forum.inductiveautomation.com/t/dynamic-delay-timer-in-gateway-event-scripts/39251>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [October 1, 2020, 6:17am UTC](https://forum.inductiveautomation.com/t/dynamic-delay-timer-in-gateway-event-scripts/39251 "2020-10-01T06:17:27Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [October 1, 2020, 12:14pm UTC](https://forum.inductiveautomation.com/t/dynamic-delay-timer-in-gateway-event-scripts/39251/2 "2020-10-01T12:14:22Z")

</div>

Run a timer at a much shorter interval (per your precision requirements) and check in your own logic whether nested logic is "due". I recommend using a datetime memory tag to hold the "next due" timestamp. See this similar topic:

> [@Gateway tag change or Gateway timer scripts expressions and delays](http://forum.inductiveautomation.com/t/gateway-tag-change-or-gateway-timer-scripts-expressions-and-delays/39147/5):
>
> Something like this (I would delegate to a script module): tagpaths = ['[default]'+y for y in ['Cond1', 'Cond2', 'NotBefore']] def conditionalRun(event): cond1, cond2, notbefore = [x.value for x in system.tag.readAll(tagpaths)] # Check run permissives if cond1 and cond2: # Check Not Before criteria now = system.date.now() if now.before(notbefore): return system.tag.write(tagpaths[-1], system.date.addDays(now, 14)) # Do actions that must not repeat faster that every two weeks.…

---

_[View the full topic](https://forum.inductiveautomation.com/t/dynamic-delay-timer-in-gateway-event-scripts/39251)._
