How do I keep track of the runtime of an application.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
What do you mean by runtime? The time elapsed after you launch an application?
I don’t think there is any direct method that can give you the elapsed time. You can maintain a timer on you own.
You can also use
System.nanoTime()to get the most accurate timing.Edit—
Yes i think Ben is correct.. If you want to just measure how long a process is running then you can try using this approach
android.os.Process.getElapsedCpuTime()– This should return the elapsed milliseconds your process has run. I believe your application also should run on a unique process ID. So that time should be fine