No,
When Thread.Sleep is used no validation is done after the sleep has ended. It can be that the script timed out, then the script will stop.
When using engine.Sleep a validation is done whether or not the script has timed out. When a timeout happend during the sleep an TimeoutException is thrown.
Marieke Goethals [SLC] [DevOps Catalyst] Selected answer as best 18th July 2023
I think about my knowledge you didn't reference the namespace of ( using System.Threading;) when you want to use ( Thread.Sleep(ms); ) in either could be an Automation Script or QAction code.
I hope that Help YOU.
Marieke Goethals [SLC] [DevOps Catalyst] Selected answer as best 18th July 2023
It’s not the namespace that is missing, it isn’t advised to use System.Threading.Thread.Sleep(int) in an automation script. Because the script can timeout during a sleep. And when the sleep ends the script will just stop. While if engine.Sleep(int) is used, a check will be done to see if the script is timed out. And it will throw an exception if the script has timed out.