public class nanoTime
public static void main(String... args)
System.out.println("Found JVM: "
+ " " + System.getProperty("java.vm.vendor")
+ " " + System.getProperty("java.version")
+ " " + System.getProperty("java.vm.name")
System.out.println("time is "+ System.nanoTime());
~ gdate +%s%N && javac7-oraclejdk nanoTime.java && java7-oraclejdk nanoTime
Found JVM: Oracle Corporation 1.7.0_80 Java HotSpot(TM) 64-Bit Server VM
time is 1480143769807547000
~ gdate +%s%N && javac nanoTime.java && java nanoTime
Found JVM: Oracle Corporation 1.8.0_92 Java HotSpot(TM) 64-Bit Server VM
time is 527819867675375
System.nanoTime() javadoc says,
The same origin is used by all invocations of this method in an instance of a Java virtual machine; other virtual machine instances are likely to use a different origin.
The values returned by this method become meaningful only when the difference between two such values, obtained within the same instance of a Java virtual machine, is computed.
You are comparing results across different JVM instances (and with different origins and versions). That is not meaningful. It is perfectly legal for the implementation to change between Java versions, as long as the behavior specified in the API is preserved.