How to convert a value from nanoseconds to seconds?
Here\'s the code segment:
import java.io.*; import java.util.concurrent.*; .. class Stamper
This will convert a time to seconds in a double format, which is more precise than an integer value:
double elapsedTimeInSeconds = TimeUnit.MILLISECONDS.convert(elapsedTime, TimeUnit.NANOSECONDS) / 1000.0;