# Python's Timer: from threading import Timer

**URL:** <https://forum.inductiveautomation.com/t/pythons-timer-from-threading-import-timer/64268>\
**Category:** Ignition\
**Tags:** perspective, scripting, ignition81\
**Created:** [September 20, 2022, 8:28am UTC](https://forum.inductiveautomation.com/t/pythons-timer-from-threading-import-timer/64268 "2022-09-20T08:28:56Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![tupanaster](https://avatars.discourse-cdn.com/v4/letter/t/5daacb/32.png) [@tupanaster](https://forum.inductiveautomation.com/u/tupanaster)\
**Post date:** [September 20, 2022, 11:18am UTC](https://forum.inductiveautomation.com/t/pythons-timer-from-threading-import-timer/64268/4 "2022-09-20T11:18:56Z")

</div>

I think I would need to combine both: Python's timer and invokeAsync. Because invokeAsync doesn't have a fixed time as a parameter.

From this post: [AttributeError: ‘com.inductiveautomation.ignition.common.script.Imm’ object has no attribute ‘invokeLater’](https://forum.inductiveautomation.com/t/attributeerror-com-inductiveautomation-ignition-common-script-imm-object-has-no-attribute-invokelater/41151)

> [@AttributeError: 'com.inductiveautomation.ignition.common.script.Imm' object has no attribute 'invokeLater'](https://forum.inductiveautomation.com/t/attributeerror-com-inductiveautomation-ignition-common-script-imm-object-has-no-attribute-invokelater/41151/6):
>
> Jython’s Timer seems fine, but it’s conceptually no different than just using `invokeAsync` and then sleeping as the first thing you do for the amount of delay you desire. Both end up using a dedicated Thread.

They both seem the same but probably some minor differences.

Edit #1:  
I think it would be nice to call the timer through an invokeAsync to get a description of the thread in the gateway. Maybe I'll create two threads by doing so. Any thoughts on this?

---

_[View the full topic](https://forum.inductiveautomation.com/t/pythons-timer-from-threading-import-timer/64268)._
