+ 2

Java Output Delay

I have been trying to delay the output in my code but it just shows Time Out and keeps exiting. Do i need to import any package? Are there any other method which carries out the same function? Btw may i know which java version is in this application? THANKS!! Here's my code - try{ System.out.println("Output is "); Thread.sleep(4000); } catch (Exception e) { //nothing }

21st Apr 2020, 5:59 PM
Big Billy Boy
Big Billy Boy - avatar
5 Antworten
+ 1
using a value of 2000 gets a timeout, but a value of 1500 works. The system probably has a 2 second execution limit to limit system overload, endless loops, etc.
21st Apr 2020, 7:42 PM
Chris Persichetti
Chris Persichetti - avatar
0
I think in Sololearn, thread sleep don't works....
21st Apr 2020, 6:30 PM
Jayakrishna 🇮🇳
0
So is there any way in which i can delay the output?
21st Apr 2020, 6:41 PM
Big Billy Boy
Big Billy Boy - avatar
0
On Sololearn you have only 5 seconds before time out.
21st Apr 2020, 6:50 PM
Denise Roßberg
Denise Roßberg - avatar
0
Chris Persichetti Maybe they reduced the time limit. Connection issues plays also a role.
21st Apr 2020, 7:44 PM
Denise Roßberg
Denise Roßberg - avatar