Question regarding output shown after converting nanoseconds to seconds

39 views Asked by At

I'm having trouble understanding the output generated by the code below.

The code segment:

        long startTime= System.nanoTime();
        //method that I am measuring.
        long endTime = System.nanoTime();
        long elapsedTime = endTime - startTime;
        double seconds = (double)elapsedTime / 1_000_000_000.0;

        System.out.println(seconds+"secs");

One of the outputs that I got:

 1.397E-4 secs
1

There are 1 answers

0
arcadeblast77 On

1.397E-4 is the same as 0.0001397