Update: If you don't mind using external libraries and using JDK 5+, Google Guava has a Stopwatch that uses System.nanoTime(). It is not related to the absolute operating time of a system or wall, but instead is only useful in calculating the elapsed time, but this is exactly what you want.
Otherwise, you can use System.currentTimeMillis()that returns the current system time in milliseconds as a long integer.
long start = System.currentTimeMillis();
long time = System.currentTimeMillis() - start;
System.out.println("Operation took " + time + "ms");
, , . Java.
, , , . , .