long start = System.currentTimeMillis(); // some time passes long end = System.currentTimeMillis(); long elapsedTime = end - start;