public void benchmark(int sizeInK) {
        System.out.println("Warming up...");
        escapeStrings(1000); // warm-up

        System.out.println("Starting benchmark...");
        long startTime=System.currentTimeMillis();
        escapeStrings(sizeInK);
        long endTime=System.currentTimeMillis();
        System.out.println("Done.\nEscaping " + sizeInK + "k strings took " + (endTime-startTime) + "ms");
    }
It is what it says

@author bratseth
vespajlib/developernotes/XMLMicroBenchmark.java