package com.kdgregory.example.benchmark;

/**
 *  A micro-benchmark that shows Hotspot eliminating dead code.
 *  Use the and -XX:+PrintCompilation argument to see Hotspot in
 *  action, and -server to get the most aggressive optimization.
 */
public class Micro4
{
    public static void main(String[] argv)
    throws Exception
    {
        for (int rep = 0 ; rep < 5 ; rep++)
        {
            long start = System.currentTimeMillis();
            for (int ii = 0 ; ii < 100000 ; ii++)
            {
                for (int jj = 0 ; jj < 100 ; jj++)
                    ;
            }
            long elapsed = System.currentTimeMillis() - start;
            System.out.println("pass " + rep + " elapsed time = " + elapsed + "ms");
        }
    }
}
