# Stop a Timer

**URL:** <https://forum.inductiveautomation.com/t/stop-a-timer/7601>\
**Category:** Ignition\
**Created:** [November 20, 2013, 9:06pm UTC](https://forum.inductiveautomation.com/t/stop-a-timer/7601 "2013-11-20T21:06:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![controlsim](https://avatars.discourse-cdn.com/v4/letter/c/47e85d/32.png) [@controlsim](https://forum.inductiveautomation.com/u/controlsim)\
**Post date:** [November 20, 2013, 9:06pm UTC](https://forum.inductiveautomation.com/t/stop-a-timer/7601/1 "2013-11-20T21:06:51Z")

</div>

Hi, could you please help me with this? I have a button to start a timer changing the running attribute, but I want to stop the timer when reach 100, I have this on the button but it doesn’t work.

value = 1  
value2 = 0  
event.source.parent.getComponent(‘Timer’).running = value

if event.source.parent.getComponent(‘Timer’).value == 100 :  
event.source.parent.getComponent(‘Timer’).running = value2

---

<div class="post-metadata">

**Author:** ![nmudge](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nmudge/32/3394_2.png) [@nmudge](https://forum.inductiveautomation.com/u/nmudge)\
**Post date:** [November 21, 2013, 12:51am UTC](https://forum.inductiveautomation.com/t/stop-a-timer/7601/2 "2013-11-21T00:51:10Z")

</div>

Hello,

Put this code in your Button actionPerformed event script:

```auto
event.source.parent.getComponent('Timer').running = True
```

Put this code in your Timer propertyChange event script:

```auto
if event.propertyName == "value":
    if event.newValue == 100:
        event.source.running = False
```

Make sure the Bound property of the Timer component has a value greater than 100.

Nick

---

<div class="post-metadata">

**Author:** ![controlsim](https://avatars.discourse-cdn.com/v4/letter/c/47e85d/32.png) [@controlsim](https://forum.inductiveautomation.com/u/controlsim)\
**Post date:** [November 21, 2013, 2:56am UTC](https://forum.inductiveautomation.com/t/stop-a-timer/7601/3 "2013-11-21T02:56:51Z")

</div>

I appreciate your help. Thanks a lot.
