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

        System.out.println("Starting benchmark...");
        long startTime=System.currentTimeMillis();
        writeStrings(sizeInK);
        long endTime=System.currentTimeMillis();
        System.out.println("Done.\nWriting " + sizeInK + "k strings took " + (endTime-startTime) + "ms");

        if (verifyOutput) {
            System.out.println("First 1k of output:");
            String result=null;
            try { result=output.toString("utf-8"); } catch (UnsupportedEncodingException e) { throw new RuntimeException(e); }
            System.out.println(result.substring(0,Math.min(500,result.length())));
        }
    }
It is what it says

@author bratseth
vespajlib/developernotes/XMLWriterMicroBenchmark.java