Logo 
Search:

Java Answers

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds
  Question Asked By: Cesar Gonzalez   on Jan 12 In Java Category.

  
Question Answered By: Sultana Tabassum    on Jan 12

This is a little class I have used and it worked just
fine, doing exactly what you want:

class ALittleWait extends Thread {
private int sleepTime;
// Just using the Thread class
// by calling superclass Thread constructor
// to get a sleeping effect for a little while
public ALittleWait(String name)
{
super(name);
sleepTime = (int) (5000);
}
}

And you call it from your main class (or whatever)
with:

ALittleWait.sleep(2000);

Share: 

 

This Question has 4 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on Java Timeout Or get search suggestion and latest updates.


Tagged: