public void run() {
        int result=0;

        // Warm-up
        out("Warming up...");
        for (int i=0; i<10*1000; i++)
            result+=createAndAccessQuery(i);

        long startTime=System.currentTimeMillis();
        out("Running...");
        for (int i=0; i<100*1000; i++)
            result+=createAndAccessQuery(i);
        out("Ignore this: " + result); // Make sure we are not fooled by optimization by creating an observable result
        long endTime=System.currentTimeMillis();
        out("Creating and accessing a query 100.000 times took " + (endTime-startTime) + " ms");
    }
Tests the speed of accessing the query

@author bratseth
container-search/src/test/java/com/yahoo/search/test/QueryBenchmark.java