// elapsed time with System.currentTimeMillis // Works in all JDK versions long start = System.currentTimeMillis(); // .. do something // elapsed time in microseconds, millionths of a second long elapsed = System.currentTimeMillis() - start;