public static void main(String[] args){
        int minTO = 50;
        int maxTO = 1500;
        int timeoutCnt = 10000;
        int trials = 10;
        boolean sleep = false;
        long sleepTime = 50;
        MinContainer<Timeout> c = new MinContainer<>();
        Timeout[] timeouts = new Timeout[timeoutCnt];
        Random r = new Random();
        double period_ms;
        long start = System.nanoTime();
        for (int d = 0; d < trials; d++) {
            for (int i = 0; i < timeoutCnt; i++) {
                int randTO = minTO + r.nextInt(maxTO - minTO + 1);
                timeouts[i] = new Timeout(null, null, randTO);
                c.add(timeouts[i]);
                if (sleep) {
                    try {
                        Thread.sleep(sleepTime);
                    } catch (InterruptedException ie) {
                    }
                }
            }
        }
        period_ms = (System.nanoTime() - start) / 1000000d;
        System.out.println("Took " + period_ms/trials + "ms to create and add " + timeoutCnt + " timeouts over " + trials + " trials");
        start = System.nanoTime();
        for (int d = 0; d < trials; d++) {
            //System.out.println("Trial " + d);
            for (int i = 0; i < timeoutCnt; i++) {
                //System.out.println("Timeout " + i);
                c.remove(timeouts[i]);
                if (sleep) {
                    try {
                        Thread.sleep(sleepTime);
                    } catch (InterruptedException ie) {
                    }
                }
            }
        }
        period_ms = (System.nanoTime() - start) / 1000000d;
        System.out.println("Took " + period_ms/trials + "ms to remove " + timeoutCnt + " timeouts over " + trials + " trials");
    }