New To Java - exceptions with sleep(long millis) method

okay, so i'm new to Java and i'm taking a course in it right now. But I was wodndering how to use the sleep(long millis) method in java.lang.Object

I want one of my methods to run every minute (60,000 milliseconds) and the sleep method throws an InterruptedException.. anyone want to enlighten me and show me how to do that?

i tried sleep(60000) throws new InterruptedException

but it didnt work.

[423 byte] By [dopey080a] at [2007-11-26 23:17:26]
# 1
You need to understand Exceptions: http://java.sun.com/docs/books/tutorial/essential/exceptions/index.html
DrLaszloJamfa at 2007-7-10 14:18:47 > top of Java-index,Java Essentials,New To Java...
# 2

And in the meanwhile, you could just wrap it. Implement and call this function

to make sleeping easier:

public static void nap(long millis) {

try {

Thread.sleep(millis);

} catch (InterruptedException e) {

throw new RuntimeException(e);

}

}

DrLaszloJamfa at 2007-7-10 14:18:47 > top of Java-index,Java Essentials,New To Java...