Examples of StopWatch


Examples of org.eclipse.xtext.util.StopWatch

   */
  @Test
  public void testFormatCode() {
    final Utils utils = new Utils();
    String code = "";
    final StopWatch watch = new StopWatch();
    IntegerRange _upTo = new IntegerRange(0, 1);
    for (final Integer i : _upTo) {
      LangDef _langDef = this.langDef();
      String _formatCode = utils.formatCode("mein foo ist bar nicht baz.", _langDef);
      code = _formatCode;
    }
    watch.resetAndLog("keywords");
    Assert.assertEquals("mein&nbsp;<span class=\"keyword\">foo</span>&nbsp;ist&nbsp;<span class=\"keyword\">bar</span>&nbsp;nicht&nbsp;<span class=\"keyword\">baz</span>.", code);
  }
View Full Code Here

Examples of org.elasticsearch.common.StopWatch

//                .startObject("field").field("index", "analyzed").field("omit_norms", false).endObject()
                .endObject()
                .endObject().endObject()).execute().actionGet();
        Thread.sleep(5000);

        StopWatch stopWatch = new StopWatch().start();
        long COUNT = SizeValue.parseSizeValue("2m").singles();
        int BATCH = 500;
        System.out.println("Indexing [" + COUNT + "] ...");
        long ITERS = COUNT / BATCH;
        long i = 1;
        int counter = 0;
        for (; i <= ITERS; i++) {
            BulkRequestBuilder request = client1.prepareBulk();
            for (int j = 0; j < BATCH; j++) {
                counter++;
                request.add(Requests.indexRequest("test").type("type1").id(Integer.toString(counter)).source(source(Integer.toString(counter), "test" + counter)));
            }
            BulkResponse response = request.execute().actionGet();
            if (response.hasFailures()) {
                System.err.println("failures...");
            }
            if (((i * BATCH) % 10000) == 0) {
                System.out.println("Indexed " + (i * BATCH) + " took " + stopWatch.stop().lastTaskTime());
                stopWatch.start();
            }
        }
        System.out.println("Indexing took " + stopWatch.totalTime() + ", TPS " + (((double) COUNT) / stopWatch.totalTime().secondsFrac()));

        client.client().admin().indices().prepareRefresh().execute().actionGet();
        System.out.println("Count: " + client.client().prepareCount().setQuery(matchAllQuery()).execute().actionGet().count());

        client.close();
View Full Code Here

Examples of org.encog.engine.util.Stopwatch

    this.training = training;
    this.low = low;
    this.high = high;
    this.owner = owner;

    this.stopwatch = new Stopwatch();

    this.layerDelta = new double[network.getLayerOutput().length];
    this.gradients = new double[network.getWeights().length];
    this.actual = new double[network.getOutputCount()];
View Full Code Here

Examples of org.encog.util.Stopwatch

  /**
   * {@inheritDoc}
   */
  @Override
  public final void run() {
    final Stopwatch watch = new Stopwatch();
    try {
      watch.start();

      this.currentJob.createTrainer(this.manager.isSingleThreaded());
      final MLTrain train = this.currentJob.getTrain();
      int interation = 1;

      while (this.currentJob.shouldContinue()) {
        train.iteration();
        interation++;
      }
      watch.stop();
    } catch (final Throwable t) {
      this.currentJob.setError(t);
    } finally {
      this.ready.set(true);
      this.manager.jobDone(watch.getElapsedMilliseconds(), this);
    }
  }
View Full Code Here

Examples of org.fest.swing.test.util.StopWatch

* @author Alex Ruiz
*/
public class Pause_pauseWithTimeoutInTimeUnit_Test {
  @Test
  public void should_pause_for_the_given_amount_of_time() {
    StopWatch watch = startNewStopWatch();
    long delay = 2000;
    Pause.pause(2, TimeUnit.SECONDS);
    watch.stop();
    assertThat(watch.ellapsedTime() >= delay).isTrue();
  }
View Full Code Here

Examples of org.hsqldb.lib.StopWatch

            }

            printWithThread("Opening database: [" + dbType[i] + dbPath[i]
                            + "]");

            StopWatch sw = new StopWatch();
            int       id;

            try {
                id = DatabaseManager.getDatabase(dbType[i], dbPath[i], this,
                                                 dbProps[i]);
                dbID[i] = id;
                success = true;
            } catch (HsqlException e) {
                printError("Database [index=" + i + ", db=" + dbType[i]
                           + dbPath[i] + ", alias=" + dbAlias[i]
                           + "] did not open: " + e.toString());
                setServerError(e);

                dbAlias[i] = null;
                dbPath[i= null;
                dbType[i= null;
                dbProps[i] = null;

                continue;
            }

            sw.stop();

            String msg = "Database [index=" + i + ", id=" + id + ", db="
                         + dbType[i] + dbPath[i] + ", alias=" + dbAlias[i]
                         + "] opened sucessfully";

            print(sw.elapsedTimeToMessage(msg));
        }

        printWithThread("openDatabases() exiting");

        if (isRemoteOpen) {
View Full Code Here

Examples of org.hsqldb_voltpatches.lib.StopWatch

        ScriptReaderBase scr = null;
        String           statement;
        int              statementType;

        try {
            StopWatch sw = new StopWatch();

            scr = ScriptReaderBase.newScriptReader(database, logFilename,
                                                   logType);

            while (scr.readLoggedStatement(current)) {
View Full Code Here

Examples of org.jamesii.core.util.StopWatch

   */
  private double runExperiment(Long rngSeed, PerfDBRecorder perfRecorder) {
    if (rngSeed != null) {
      SimSystem.getRNGGenerator().setSeed(rngSeed);
    }
    StopWatch watch = new StopWatch();
    perfRecorder.start();
    watch.start();
    experiment.execute();
    watch.stop();
    perfRecorder.stop();
    elapsedTime = watch.elapsedSeconds();
    return elapsedTime;
  }
View Full Code Here

Examples of org.javasimon.Stopwatch

    addMemoryPageAndGetFirstSlot();
    logger.info("Cache initialization ok");
  }
 
  public void disposeExpired() {
        Stopwatch stopWatch = SimonManager.getStopwatch("detail.disposeExpired");
    Split split = stopWatch.start();
   
    for (Iterator<CacheEntry> iterator = entries.values().iterator(); iterator.hasNext();) {
      CacheEntry entry = iterator.next();
      if (entry.expired()) {
        remove(entry.key);
View Full Code Here

Examples of org.jboss.dna.common.statistic.Stopwatch

                                     testName,
                                     depths[j],
                                     breadths[i],
                                     properties[k],
                                     false,
                                     new Stopwatch(),
                                     System.out,
                                     null);
                }
            }
        }
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.