Package util

Examples of util.StopWatch.stop()


            for (int index = Byte.MIN_VALUE; index <= Byte.MAX_VALUE; index++) {
              final int value = streamIn.read();
              assertEquals(value, index);
            }
          }
          timer.stop();
          log.info("timer : {}", timer.nanoString());
          synchronized (this) {
            this.notifyAll();
          }
        } catch (final Exception e) {
View Full Code Here


            streamOut.write(arrayOut);
            final int count = streamIn.read(arrayIn);
            assertEquals(count, size);
            assertTrue(Arrays.equals(arrayIn, arrayOut));
          }
          timer.stop();
          log.info("timer : {}", timer.nanoString());
          synchronized (this) {
            this.notifyAll();
          }
        } catch (final Exception e) {
View Full Code Here

            streamOut.write(arrayOut);
            final int count = streamIn.read(arrayIn);
            assertEquals(count, size);
            assertTrue(Arrays.equals(arrayIn, arrayOut));
          }
          timer.stop();
          log.info("timer : {}", timer.nanoString());
          synchronized (this) {
            this.notifyAll();
          }
        } catch (final Exception e) {
View Full Code Here

    timer.start();
    for (int k = 0; k < COUNT; k++) {
      // baseline
    }
    timer.stop();
    nanos = timer.nanoTime() / COUNT;
    log.info("baseline nanos={}", nanos);

    timer.start();
    for (int k = 0; k < COUNT; k++) {
View Full Code Here

    timer.start();
    for (int k = 0; k < COUNT; k++) {
      // small array
      final byte[] array = new byte[128];
    }
    timer.stop();
    nanos = timer.nanoTime() / COUNT;
    log.info("make array 123; nanos={}", nanos);

    timer.start();
    for (int k = 0; k < COUNT; k++) {
View Full Code Here

    timer.start();
    for (int k = 0; k < COUNT; k++) {
      // medium array
      final byte[] array = new byte[1024];
    }
    timer.stop();
    nanos = timer.nanoTime() / COUNT;
    log.info("make array 1024; nanos={}", nanos);

    final int[] arrayInt = new int[SIZE];
    timer.start();
View Full Code Here

    final int[] arrayInt = new int[SIZE];
    timer.start();
    for (int k = 0; k < COUNT; k++) {
      Arrays.fill(arrayInt, 1235678);
    }
    timer.stop();
    nanos = timer.nanoTime() / COUNT / SIZE;
    log.info("fill array; nanos={}", nanos);

    //
View Full Code Here

      for (final Integer i : array) {
        // iterate array
        final Integer x = i;
      }
    }
    timer.stop();
    nanos = timer.nanoTime() / COUNT / 1024;
    log.info("iterate array; nanos={}", nanos);

    // SET
    final Set<Integer> set = new HashSet<Integer>();
View Full Code Here

      for (final Integer i : set) {
        // iterate set
        final Integer x = i;
      }
    }
    timer.stop();
    nanos = timer.nanoTime() / COUNT / 1024;
    log.info("iterate set; nanos={}", nanos);
    //
    timer.start();
    for (int k = 0; k < COUNT; k++) {
View Full Code Here

    //
    timer.start();
    for (int k = 0; k < COUNT; k++) {
      final Object[] x = set.toArray();
    }
    timer.stop();
    nanos = timer.nanoTime() / COUNT;
    log.info("set to array; nanos={}", nanos);

  }
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.