Exemplo n.º 1
0
  public static void main(String[] args) throws InterruptedException, FileNotFoundException {
    // TODO Auto-generated method stub
    System.setOut(new PrintStream("c:\\1.txt"));
    Thread t1_1 = new m1();
    Thread t1_2 = new m1();

    t1_1.start();
    t1_2.start();

    long s = System.currentTimeMillis();
    t1_1.join();
    t1_2.join();
    logger.Log.info(System.currentTimeMillis() - s);
    logger.Log.info("value:" + c1);

    Thread t2_1 = new m2();
    Thread t2_2 = new m2();

    t2_1.start();
    t2_2.start();
    s = System.currentTimeMillis();
    t2_1.join();
    t2_2.join();
    logger.Log.info(System.currentTimeMillis() - s);
    logger.Log.info("value:" + c2);

    Thread t3_1 = new m3();
    Thread t3_2 = new m3();

    t3_1.start();
    t3_2.start();
    s = System.currentTimeMillis();
    t3_1.join();
    t3_2.join();
    logger.Log.info(System.currentTimeMillis() - s);
    logger.Log.info("value:" + c3);
  }
Exemplo n.º 2
0
  public void Sort(T[] a, Comparator<? extends T> c) {

    logger.Log.info("you call ");
  }