Sleep in TM1: How to Pause a TI Process
Have you ever need to make a Turbo Integrator process sleep for a short while so another system can catch up? Getting a TI to pause can be a really useful step to include where you’re waiting on an external process to complete (like a file to be written by the operating system). It can also be really useful for having a TI pause where you want it to wait and then have it go back an repeatedly check for a condition to be true.
Sleep Function Syntax
The syntax of the sleep is very simple. It is just:
sleep ( n );
where n is the number of milli seconds you want it to wait.
An example of the sleep function is:
# Pause TI for 5 Seconds nSleep = 5000; sleep ( nSleep );
This will cause the process to wait for 5 seconds until it continues.
The sleep function can be used in the following ways:
- Where you are waiting for an external process to finish.
- You need to loop back and check for a condition to be true. Yes, I know you could have a repeatedly scheduled chore to do it too.
- There’s a master TI that is using ExecuteProcess to call a range of child processes and need to insert a wait step between some of the child steps.