try{
//do what you want to do before sleeping
Thread.currentThread().sleep(1000);//sleep for 1000 ms
//do what you want to do after sleeptig
}
catch(ItrerruptedException ie){
//If this thread was intrrupted by nother thread
}

In case anyone is interested in more information on using Thread.sleep() and how its behaviour is affected by system performance, I have some information on my web site on Thread.sleep() behaviour. One important point to note is that if timing is fairly critical to your application (note that you can never make it very critical with Thread.sleep()), e.g. for animation, then you should generally time how long the thread actually slept and make appropriate adjustments.

Well, any static method in the language can be invoked on an object reference instead of the class. But that doesn't change the functionality: Thread.sleep() is a static method that puts the current thread to sleep.

Agree that if it matters to you how long the thread actually sleeps, then you need to measure this, because it's not necessarily (and usually won't be) exactly the requested sleep time (see, for example, the measurements of Thread.sleep() behaviour that I've made under XP with different levels of system load).