• Post Reply Bookmark Topic Watch Topic
  • New Topic

to make a application to pause  RSS feed

 
kamesh aru
Ranch Hand
Posts: 150
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
should we use Thread.sleep(1000);
or any other method for the application to pause for some time before executing next step in the application?

thanks in advance
 
Karthik Krishnamurthy
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That seems to be the most logical step.
However there are cruder methods to do the same for eg:

long startTime = System.currentTimeMillis();
while(true){
long endTime = System.currentTimeMillis();
if (endTime - startTime >= timeToPause)
break;
}
// do Rest of the processing
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!