-
Posts
669 -
Joined
-
Last visited
-
Days Won
3 -
Feedback
100%
Community Answers
-
PolishCivil's post in Getting run time, then painting run time to screen was marked as the answer
System.currenttimemilis()
returns current syste time in miliseconds
So:
onstart() -> startTime = System.currenttimemilis()
onPaint() -> timeElapsed = System.currentTimeMilis() - startTime;
Then u can do
long second = (timeElapsed / 1000) % 60
long minute = (timeElapsed / (1000 * 60)) % 60
long hour = (timeElapsed / (1000 * 60 * 60)) % 24