Hello,
Check out the following code
Code:
/ / Get current time
long str = System.currentTimeMillis();
/ / Do something ...
/ / Get time elapsed in milliseconds
long elapsedTimeMillis = System.currentTimeMillis()-str;
/ / Get elapsed time in seconds
float sts = elapsedTimeMillis/1000F;
/ / Get elapsed time in minutes
float elapsedTimeMin = elapsedTimeMillis /(60* 1000F);
/ / Get elapsed time in hours
float eth = elapsedTimeMillis /(60*60* 1000F);
/ / Get elapsed time in days
float etd = elapsedTimeMillis /(24*60*60* 1000F);
Bookmarks