Description of these two methods in the Oracle API: System.exit() : "Terminates the currently running Java Virtual Machine." System.nanoTime() : "The value returned represents nanoseconds since some fixed but arbitrary origin time. 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." Based on the above, I was curious to see what result the nanoTime() method returns. I converted the result to show the elapsed time in minutes. The result was 64. I guess it was calculated from the moment my computer was turned on, since it had been on for about an hour. I then ran another program. In it I used System.exit(), which is supposedly kills the current instance of the JVM. I then ran the first program again, to measure the elapsed time with nanoTime() method . My expectation was that this time I should get zero minutes, since I had "killed" the previous instance of the JVM, so another instance should probably be running now, and I figured that this other instance would surely use a different origin point as the basis for the measure of nanoseconds. But it didn't, the result was 67 minutes, so the same origin point was used by JVM now too. How is this possible? Is the other JVM instance also based on the same origin point? (Maybe JVM borrows the origin point from Windows?) Or am I misunderstanding what means "another instance of the JVM". If a Java program ends, and I run another program, doesn't that mean another JVM instance?
Question about System.exit() and System.nanoTime() and JVM instances