I'm not certain I understand your use case, but I'll make a guess and take a
stab at an answer:
1. You want to time how long it takes someone to do a certain task. This
is rather simply done using System.currentTimeMillis(). You can start the time
at the beginning, stop at the end and then check how long it took them to do
the task.
2. You want to give someone a task and cut it off after a certain while,
or have another action happen after a certain time. You have two options: You
can either poll using the method described above and keep checking
currentTimeMillis, OR use a Timer and a TimerTask. Look up the midp
documentation on Timer here:
http://java.sun.com/javame/reference/apis/jsr118/java/util/Timer.html.
HTH,
-Rushabh
________________________________
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Sergio Ordoño
Marín
Sent: Wednesday, March 21, 2007 4:11 PM
To: [email protected]
Subject: [Eclipseme-users] Timer
Hi, thanks for the help the other day. :)
I have another question, I think it's an easy one too.
I want to create a timer to count the seconds the players take to finish the
levels of each puzzle.
I usually create timers with javax.swing.Timer in J2EE but it looks like this
time around it won't work. I can't find the package or anything similar in the
ones available in J2ME.
Can u guys give me some hints about how to create a timer?. Maybe some links
with documentation, if possible, or other ways to do it. I'm thinking of
getting the time of the inner clock of each cellphone and use that as a timer,
but I don't know if that is possible.
Thanks for any 'incoming' help!
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Eclipseme-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/eclipseme-users