Package org.apache.niolex.commons.test

Examples of org.apache.niolex.commons.test.StopWatch.start()


        w.print();
        // --
        w.begin(true);
        for (int i = 0; i < 1000; ++i) {
            TIntCharMap primary = new TIntCharHashMap();
            Stop s = w.start();
            for (int j = 0; j < 10000; ++j) {
                primary.put(j, (char)((j % 2) + '0'));
            }
            for (int j = 0; j < 10000; ++j) {
                Check.isTrue(primary.get(j) == (char)((j % 2) + '0'));
View Full Code Here


        w.print();
        // --
        w.begin(true);
        for (int i = 0; i < 1000; ++i) {
            Int2CharMap int2c = new Int2CharOpenHashMap();
            Stop s = w.start();
            for (int j = 0; j < 10000; ++j) {
                int2c.put(j, (char)((j % 2) + '0'));
            }
            for (int j = 0; j < 10000; ++j) {
                Check.isTrue(int2c.get(j) == (char)((j % 2) + '0'));
View Full Code Here

    StopWatch w = new StopWatch(1);
    w.begin(true);
    // This is slower!
    for (int i = 0; i < 1000; ++i) {
        IntList inList = new ArrayIntList(10000);
      Stop s = w.start();
      for (int j = 0; j < 10000; ++j) {
        inList.add(j);
      }
      s.stop();
    }
View Full Code Here

    // ------------
    w = new StopWatch(1);
    w.begin(true);
    for (int i = 0; i < 1000; ++i) {
        ArrayList<Integer> oList = new ArrayList<Integer>(10000);
      Stop s = w.start();
      for (int j = 0; j < 10000; ++j) {
        oList.add(j);
      }
      s.stop();
    }
View Full Code Here

  public static void main(String[] argv) throws IOException {
    StopWatch sw = new StopWatch(10);

    sw.begin(true);
    for (int i = 0; i < 500; ++i) {
      Stop s = sw.start();
      int k = directRead();
      if (k != 9910842) {
        System.out.println("ERR " + k);
        break;
      }
View Full Code Here

    sw.done();
    sw.print();

    sw.begin(true);
    for (int i = 0; i < 500; ++i) {
      Stop s = sw.start();
      int k = bufferRead();
      if (k != 9910842) {
        System.out.println("ERR " + k);
        break;
      }
View Full Code Here

        FileChannel channel = file.getChannel();
        long tt = file.length();
        MappedByteBuffer map = channel.map(MapMode.READ_ONLY, 0, tt);
    sw.begin(true);
    for (int i = 0; i < 500; ++i) {
      Stop s = sw.start();
      int k = mmapRead(map, tt);
      if (k != 9910842) {
        System.out.println("ERR " + k);
        break;
      }
View Full Code Here

  public static void main(String[] argv) throws IOException {
    StopWatch sw = new StopWatch(10);

    sw.begin(true);
    for (int i = 0; i < 500; ++i) {
      Stop s = sw.start();
      int k = directRead();
      if (k != 9910842) {
        System.out.println("ERR " + k);
        break;
      }
View Full Code Here

    sw.done();
    sw.print();

    sw.begin(true);
    for (int i = 0; i < 500; ++i) {
      Stop s = sw.start();
      int k = bufferRead();
      if (k != 9910842) {
        System.out.println("ERR " + k);
        break;
      }
View Full Code Here

    sw.done();
    sw.print();

    sw.begin(true);
    for (int i = 0; i < 500; ++i) {
      Stop s = sw.start();
      int k = mmapRead();
      if (k != 9910842) {
        System.out.println("ERR " + k);
        break;
      }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.