ambuli
asked on
Java timer example
Hi Experts,
I need to have a timer that fires up an event when the specified time is elapsed. How can I do this. Please provide a simple example.
Thanks,
I need to have a timer that fires up an event when the specified time is elapsed. How can I do this. Please provide a simple example.
Thanks,
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
:-)
The following will start the task after a one-second delay.
new java.util.Timer().schedule(new java.util.TimerTask(){
public void run(){
/* your task here */
}
}, 1000);