The Android Log feature puts down a timestamp of
MM-DD HH:MM:SS.FF3 (FF3 means 3 digits after the decimal). I would like to automatically calculate the time difference between two log entries and output it at the begining of the log, with a set amount of digits, so it is easy to read.
I do not have access to the timestamp (that i know of), so, grabbing the time myself seems like the option. I have been trying System.nanoTime, but subtracting two of them gives me different amounts of digits, besides being far more granular than i would like. Even System.currentTimeMillis() has too much information, but i guess that is okay if i cam just going to format it afterward. Formatting seems to have plenty of options too, with String.format, NumberFormat, and others.
All i want is to calculate the difference in seconds with 3 sub-second digits, with the average time being less than a second, but going over 1 second might happen rarely. This is just for a
test (in the Android forum) but i want to learn an appropriate approach. I keep thinking i know it, and then when searching google, i end up back here.
