Package org.apache.niolex.commons.test

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


            s.stop();
        }
        w.done();
        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'));
View Full Code Here


            s.stop();
        }
        w.done();
        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'));
View Full Code Here

  /**
   * @param args
   */
  public static void main(String[] args) {
    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) {
View Full Code Here

    }
    w.done();
    w.print();
    // ------------
    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);
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);
View Full Code Here

      s.stop();
    }
    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);
View Full Code Here

    RandomAccessFile file = new RandomAccessFile("D:\\data\\miui\\MiFlash20120723.zip", "r");
        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);
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);
View Full Code Here

      s.stop();
    }
    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);
View Full Code Here

      s.stop();
    }
    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);
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.