M
mimisam
hi,
I have a program(like the following codes) which needs to sleep for 20
seconds. How can i make it stop sleeping if i want it to be alive
before 20 seconds is up?(e.g. when a cancel button is clicked).
Any help will be appreciated !!
Thanks.
public static void a()
{
delay(20000);
}
public static void delay(int d)
{
try {
Thread.sleep(d);
} catch (InterruptedException e) {}
}
I have a program(like the following codes) which needs to sleep for 20
seconds. How can i make it stop sleeping if i want it to be alive
before 20 seconds is up?(e.g. when a cancel button is clicked).
Any help will be appreciated !!
Thanks.
public static void a()
{
delay(20000);
}
public static void delay(int d)
{
try {
Thread.sleep(d);
} catch (InterruptedException e) {}
}