Package com.google.common.base

Examples of com.google.common.base.Stopwatch.reset()


    @Override
    public void run() {
      Stopwatch sw = new Stopwatch();
      Map<String, GcTimes> gcTimesBeforeSleep = getGcTimes();
      while (shouldRun) {
        sw.reset().start();
        try {
          Thread.sleep(SLEEP_INTERVAL_MS);
        } catch (InterruptedException ie) {
          return;
        }
View Full Code Here


          tree.insert(new float[]{(float) (rand.nextDouble() * 100), (float) (rand.nextDouble() * 100)}, i);
        }
        long stop = stopwatch.elapsedMillis();
        System.out.printf("[%,d]: insert = %,d ms%n", numPoints, stop);

        stopwatch.reset().start();
        ImmutableRTree searchTree = ImmutableRTree.newImmutableFromMutable(tree);
        stop = stopwatch.elapsedMillis();
        System.out.printf("[%,d]: size = %,d bytes%n", numPoints, searchTree.toBytes().length);
        System.out.printf("[%,d]: buildImmutable = %,d ms%n", numPoints, stop);

View Full Code Here

        ImmutableRTree searchTree = ImmutableRTree.newImmutableFromMutable(tree);
        stop = stopwatch.elapsedMillis();
        System.out.printf("[%,d]: size = %,d bytes%n", numPoints, searchTree.toBytes().length);
        System.out.printf("[%,d]: buildImmutable = %,d ms%n", numPoints, stop);

        stopwatch.reset().start();

        Iterable<ImmutableGenericBitmap> points = searchTree.search(new RadiusBound(new float[]{50, 50}, radius));

        Iterables.size(points);
        stop = stopwatch.elapsedMillis();
View Full Code Here

        Iterables.size(points);
        stop = stopwatch.elapsedMillis();

        System.out.printf("[%,d]: search = %,dms%n", numPoints, stop);

        stopwatch.reset().start();

        ImmutableGenericBitmap finalSet = bf.union(points);

        stop = stopwatch.elapsedMillis();
        System.out.printf("[%,d]: union of %,d points in %,d ms%n", numPoints, finalSet.size(), stop);
View Full Code Here

          tree.insert(new float[]{(float) (rand.nextDouble() * 100), (float) (rand.nextDouble() * 100)}, i);
        }
        long stop = stopwatch.elapsedMillis();
        System.out.printf("[%,d]: insert = %,d ms%n", numPoints, stop);

        stopwatch.reset().start();
        ImmutableRTree searchTree = ImmutableRTree.newImmutableFromMutable(tree);
        stop = stopwatch.elapsedMillis();
        System.out.printf("[%,d]: size = %,d bytes%n", numPoints, searchTree.toBytes().length);
        System.out.printf("[%,d]: buildImmutable = %,d ms%n", numPoints, stop);

View Full Code Here

        ImmutableRTree searchTree = ImmutableRTree.newImmutableFromMutable(tree);
        stop = stopwatch.elapsedMillis();
        System.out.printf("[%,d]: size = %,d bytes%n", numPoints, searchTree.toBytes().length);
        System.out.printf("[%,d]: buildImmutable = %,d ms%n", numPoints, stop);

        stopwatch.reset().start();

        Iterable<ImmutableGenericBitmap> points = searchTree.search(
            new RectangularBound(
                new float[]{40, 40},
                new float[]{60, 60},
View Full Code Here

        Iterables.size(points);
        stop = stopwatch.elapsedMillis();

        System.out.printf("[%,d]: search = %,dms%n", numPoints, stop);

        stopwatch.reset().start();

        ImmutableGenericBitmap finalSet = bf.union(points);

        stop = stopwatch.elapsedMillis();
        System.out.printf("[%,d]: union of %,d points in %,d ms%n", numPoints, finalSet.size(), stop);
View Full Code Here

      InvocationSuccess keyPairApi = getKeyPairApi();
      ImplicitOptionalConverter fn = forApiVersion("2011-07-15");
      Stopwatch watch = new Stopwatch().start();
      fn.apply(keyPairApi);
      long first = watch.stop().elapsed(TimeUnit.MICROSECONDS);
      watch.reset().start();
      fn.apply(keyPairApi);
      long cached = watch.stop().elapsed(TimeUnit.MICROSECONDS);
      assertTrue(cached < first, String.format("cached [%s] should be less than initial [%s]", cached, first));
      Logger.getAnonymousLogger().info(
            "lookup cache saved " + (first - cached) + " microseconds when no annotation present");
View Full Code Here

      InvocationSuccess floatingIpApi = getKeyPairApi();
      ImplicitOptionalConverter fn = forApiVersion("2011-07-15");
      Stopwatch watch = new Stopwatch().start();
      fn.apply(floatingIpApi);
      long first = watch.stop().elapsed(TimeUnit.MICROSECONDS);
      watch.reset().start();
      fn.apply(floatingIpApi);
      long cached = watch.stop().elapsed(TimeUnit.MICROSECONDS);
      assertTrue(cached < first, String.format("cached [%s] should be less than initial [%s]", cached, first));
      Logger.getAnonymousLogger().info(
            "lookup cache saved " + (first - cached) + " microseconds when annotation present");
View Full Code Here

          p.add(HConstants.CATALOG_FAMILY, b, b);
          table.put(p);
        }
        if (i % printInterval == 0) {
          LOG.info("Put " + printInterval + "/" + stopWatch.elapsedMillis());
          stopWatch.reset();
          stopWatch.start();
        }
      }
      LOG.info("Finished a cycle putting " + namespaceSpan + " in " +
          (System.currentTimeMillis() - startTime) + "ms");
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.