ContributionsMost RecentMost LikesSolutionsRe: Difference between Delay() and time.sleep() (python) Ah okay thank you, that makes sense. The listener and the test code are both in the same script, and I guess that Python somehow allowed for multi-threading using the wait() operation. Thanks for the suggestion! Re: Difference between Delay() and time.sleep() (python) abishekhari007 Why would the aqUtils.Delay() cause a deadlock in writing to the file whereas time.sleep() does not then? Is it because the writing is supposed to happen during the delay and aqUtils.Delay() just pauses the entire script execution, including the interrupting class, whereas time.sleep() allows for it to run? Difference between Delay() and time.sleep() (python) Does someone know the qualitative difference between TestCompletes innate 'Delay()' and time.sleep() in Python? I currently have a listener to a connection to ActiveMQ via stomp, and whenever a message arrives the listener will open a file and write the message to this file. Whenever I ran the code nothing was written in the file and when I tried deleting it I got an error stating that TC was still using this file. After some debugging I switched out TC:s innate Delay() to time.sleep() and then everything suddenly works. Solved