I have a long that represents System.currentTimeMillis(). I then took another measurement of the time into a long var later in my code. I subtracted the two but now want to see that time to 3 decimal places.
Currently I use %d to format my output when printing the long var and get only non-decimal values.
longis a whole number. It doesn’t have decimal places. Do you mean you want to see seconds to three decimal places?You can do the same with nanoTime, but it is still a whole number. If you want to see decimal places you need to divide by 1e3 (micro-seconds) or 1e6 (milli-seconds) or 1e9 (seconds)