Time.sleep function in Ignition

[quote=“dlaki”]Anyone here have tried to to use time.sleep function of time module in Ignition?[/quote]Nick hints at this, but let me be more explicit:
Never, ever, use time.sleep or any other delay function in Ignition unless it is on its own asynchronous thread. Delays on the event dispatch thread (darn near everything in a client) will freeze the user interface for the duration of the delay.
Just say no to any form of sleep. When you need delays, always use system.util.invokeLater() with its delay parameter. If you don’t like the built-in function, nor Nick’s module, consider the alternatives in later.py I posted in this topic.

2 Likes