# I'd like to change the timer delay inside the timer script

**URL:** <https://forum.inductiveautomation.com/t/id-like-to-change-the-timer-delay-inside-the-timer-script/7370>\
**Category:** Ignition\
**Created:** [October 4, 2013, 1:58pm UTC](https://forum.inductiveautomation.com/t/id-like-to-change-the-timer-delay-inside-the-timer-script/7370 "2013-10-04T13:58:39Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mazeyrat](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mazeyrat/32/10955_2.png) [@mazeyrat](https://forum.inductiveautomation.com/u/mazeyrat)\
**Post date:** [October 4, 2013, 1:58pm UTC](https://forum.inductiveautomation.com/t/id-like-to-change-the-timer-delay-inside-the-timer-script/7370/1 "2013-10-04T13:58:39Z")

</div>

I’d like to change the timer delay inside the timer script  
For example execute step 1,2,3 with 5000ms delay, and step 4 and 5 with 6000ms  
I’d try to modifiy the delay inside the timer script, but no effect while running.

Any idea to acheive it ? ![:scratch:](https://us1.discourse-cdn.com/inductiveautomation/original/1X/76d1620bec252bfac07050c889ff5a91dc8a9c25.gif ":scratch:")

---

<div class="post-metadata">

**Author:** ![Robert.McKenzie](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/robert.mckenzie/32/4134_2.png) [@Robert.McKenzie](https://forum.inductiveautomation.com/u/Robert.McKenzie)\
**Post date:** [October 8, 2013, 11:15pm UTC](https://forum.inductiveautomation.com/t/id-like-to-change-the-timer-delay-inside-the-timer-script/7370/2 "2013-10-08T23:15:05Z")

</div>

The best way I can think of is to set the timer to 1000ms and create a custom property that sets the value depending on what second it is in an expression binding. Something like:`if({Root Container.Timer.value}<5,
	1,
	if({Root Container.Timer.value}<10,
		2,
		if({Root Container.Timer.value}<15,
			3,
			if({Root Container.Timer.value}<21,
				4,
				5))))`The only problem is deciding where to put the custom property, because you can’t add one to a timer component.

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [October 9, 2013, 5:38pm UTC](https://forum.inductiveautomation.com/t/id-like-to-change-the-timer-delay-inside-the-timer-script/7370/3 "2013-10-09T17:38:59Z")

</div>

Bobby’s method will work best for Gateway and Client Timer Scripts, since there’s no way to change the time base on them.

On a timer component, though, you can bind the Delay property with this expression:

`switch({Root Container.Timer.value}+1,
		3,6,8,
		2000,6000,4000,
		1000)`

The ‘+1’ is needed because the actual delay timing lags by one Value count.

---

<div class="post-metadata">

**Author:** ![Robert.McKenzie](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/robert.mckenzie/32/4134_2.png) [@Robert.McKenzie](https://forum.inductiveautomation.com/u/Robert.McKenzie)\
**Post date:** [October 9, 2013, 8:36pm UTC](https://forum.inductiveautomation.com/t/id-like-to-change-the-timer-delay-inside-the-timer-script/7370/4 "2013-10-09T20:36:58Z")

</div>

Perfect! That looks even better than my solution, Jordan.
