Jump to content
  • Advertisement
Sign in to follow this  
RiseAgainst

Timer In J2ME

This topic is 4773 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

im having lots of problems getting a timer to start for 10 seconds after an event in my j2me application, any helpful tips on how to go about this?

Share this post


Link to post
Share on other sites
Advertisement
I added a timer 2 my app yersterday, anyway incase you havent solved it yet here is how i did it...



public class MyTask extends TimerTask
{

public void run()
{
// Do your thing
}

}

Timer myTimer = new Timer();
MyTask myTask = new MyTask();

// time is in ms
final int delay = 10000;
final int repeat = 1000;
/*
* Schedules the specified task for repeated fixed-rate execution, beginning at the specified time. Subsequent
* executions take place at approximately regular intervals, separated by the specified period.
*/

myTimer.scheduleAtFixedRate(m_myTask , delay, repeat);


Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!