We are building a script that takes user inputs to be updated in a table. But the table gets updated with an user input after 1 minute. So, how to add that wait time in the script.
Hi Aditiben,
If you want to wait for 1 minute in a script, this can easily be achieved with the following line of code:
engine.Sleep(60000)
More info on engine.Sleep is here: https://docs.dataminer.services/develop/api/types/Skyline.DataMiner.Automation.Engine.Sleep.html
System.Threading.Thread.Sleep(60000);
More information can be found: https://learn.microsoft.com/en-us/dotnet/api/system.threading.thread.sleep?view=net-7.0
If you would ever have the case where you need to wait for a longer period the following could also be done:
- Create a secondary script which will perform the table update
- In the main script, create a scheduled task to be executed at the time of your liking, which will then execute the secondary script.
Best of luck with your script.
Hi Wouter,
Many thanks for the information!
I’ve updated my answer accordingly, and will also start using this instead of the Thread.sleep.
Note: if the script is an automation script, engine.Sleep(60000) is recommended over Thread.Sleep(60000). Main reason is that engine.Sleep will temporarily release resources during longer waits and will help aborted scripts stop faster.
More info on engine.Sleep is here: https://docs.dataminer.services/develop/api/types/Skyline.DataMiner.Automation.Engine.Sleep.html