It is already available in java.lang package. Try following code:
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
}