// Path: java/src/main/java/kanzi/IntSorter.java
// public interface IntSorter
// {
//     public boolean sort(int[] array, int idx, int len);
// }


import java.util.Random;
import kanzi.IntSorter;
        String empty = "                   ";
        int idx2 = sortName.length() - "arrays.sort".length();
        String adjust2 = (idx2 > 0 ) ? empty.substring(0, idx2) : "";
        int idx1 = -idx2;
        String adjust1 = (idx1 > 0 ) ? empty.substring(0, idx1) : "";

        for (int k=0; k<5; k++)
        {
            long sum = 0;
            long sum2 = 0;
            final int val = vals[k] & mask;

            for (int ii=0; ii<iters; ii++)
            {
                for (int i=0; i<array.length; i++)
                    array[i] = random.nextInt(val);

                System.arraycopy(array, 0, array2, 0, array.length);

                before = System.nanoTime();
                sorter.sort(array, 0, array.length);
                after = System.nanoTime();
                sum += (after - before);
                before = System.nanoTime();
                java.util.Arrays.sort(array2);
                after = System.nanoTime();
                sum2 += (after - before);
             }

             System.out.println("Elapsed "+sortName+adjust1+" [ms]: "+sum/1000000);
// Path: java/src/main/java/kanzi/IntSorter.java
// public interface IntSorter
// {
//     public boolean sort(int[] array, int idx, int len);
// }


// Path: java/src/test/java/kanzi/test/TestAbstractSort.java
import java.util.Random;
import kanzi.IntSorter;

        String empty = "                   ";
        int idx2 = sortName.length() - "arrays.sort".length();
        String adjust2 = (idx2 > 0 ) ? empty.substring(0, idx2) : "";
        int idx1 = -idx2;
        String adjust1 = (idx1 > 0 ) ? empty.substring(0, idx1) : "";

        for (int k=0; k<5; k++)
        {
            long sum = 0;
            long sum2 = 0;
            final int val = vals[k] & mask;

            for (int ii=0; ii<iters; ii++)
            {
                for (int i=0; i<array.length; i++)
                    array[i] = random.nextInt(val);

                System.arraycopy(array, 0, array2, 0, array.length);

                before = System.nanoTime();
                sorter.sort(array, 0, array.length);
                after = System.nanoTime();
                sum += (after - before);
                before = System.nanoTime();
                java.util.Arrays.sort(array2);
                after = System.nanoTime();
                sum2 += (after - before);
             }

             System.out.println("Elapsed "+sortName+adjust1+" [ms]: "+sum/1000000);
             System.out.println("Elapsed arrays.sort"+adjust2+" [ms]: "+sum2/1000000);