Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Question about timers

Status
Not open for further replies.

mfalomir

Technical User
Feb 6, 2003
78
MX
Hi,

I have a TimerTask called updateTask, that I want to execute every 10 seconds, so I have the follwoing timer:

Timer myTimer = new Timer(updateTask, 10000);

,which I initialize when the app gets executed, so when the first 10 seconds pass the task gets executed, but that's the only time it gest executed. Isnt supposed to get executed every 10 seconds ? Right now, what im doing is reinitializing the timer over and over

Thanks in advanced :)
 
Nevermind .... I was missing a thir parameter duh!

Timer myTimer = new Timer(updateTask, 10000, 10000);

Schedules the specified task for repeated fixed-delay execution, beginning after the specified delay.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top