Hello, in python, when I need to call a delay action, I can use time.sleep(x). What is it in Java?
Thread.sleep() ? Thanks.
- DougieLawson
- Posts: 40583
- Joined: Sun Jun 16, 2013 11:19 pm
- Location: A small cave in deepest darkest Basingstoke, UK
- Contact: Website Twitter
Re: python time.sleep(x) in java
Is your local Google broken (or is it comatose from celebrating too hard for it's 20th birthday)?
https://stackoverflow.com/questions/241 ... ay-in-java
https://stackoverflow.com/questions/241 ... ay-in-java
Any language using left-hand whitespace for syntax is ridiculous
Any DMs sent on Twitter will be answered next month.
Fake doctors - are all on my foes list.
Any requirement to use a crystal ball or mind reading will result in me ignoring your question.
Any DMs sent on Twitter will be answered next month.
Fake doctors - are all on my foes list.
Any requirement to use a crystal ball or mind reading will result in me ignoring your question.
Re: python time.sleep(x) in java
Please don't give me the attitude. I did google it, I read the same post. but My little understanding is Thread.sleep() has something to do with a thread.. I am wondering if it can be applied to general purpose like time.sleep() in python.
I am not a genius like you. Java is brand new to me.
I am not a genius like you. Java is brand new to me.
Re: python time.sleep(x) in java
The sleep() method in the Thread class is a static method and has nothing to do with any Thread in particular; you can use it and it makes your curent fall to sleep. The method can be interrupted (not very likely) but you have to embed it in a try ... catch block.tony1812 wrote: ↑Fri Sep 28, 2018 10:21 amPlease don't give me the attitude. I did google it, I read the same post. but My little understanding is Thread.sleep() has something to do with a thread.. I am wondering if it can be applied to general purpose like time.sleep() in python.
I am not a genius like you. Java is brand new to me.
kind regards,
Jos