just add a timer at the start of the program execution .... there are two types of timers .... one for gui and one is general
general:
java.util.Timer
Timer t = new Timer();
gui:
javax.swing.*
Timer t = new Timer(ActionListener, delay);
Read more about the timers in the java API.
nanosani
Unauthenticated Liar
1,830 posts since Jul 2004
Reputation Points: 45
Solved Threads: 56
What you see is in milliseconds. When you get the difference, multiply by 1000 and you will have how many seconds have passed
javaAddict
Nearly a Senior Poster
3,329 posts since Dec 2007
Reputation Points: 1,014
Solved Threads: 448
You have a value in milliseconds. You can either use SimpleDateFormat, or do it yourself using the following rules:
1 sec = 1000 millisec
1 min = 60 sec
1 hour = 60 min
And sorry about my last post, I made a very big mistake: You must divide by 1000 to get the seconds
javaAddict
Nearly a Senior Poster
3,329 posts since Dec 2007
Reputation Points: 1,014
Solved Threads: 448