Examples of Timer


Examples of org.sunflow.system.Timer

  }

  public void buildScene() {
    try {
      clearConsole();
      Timer t = new Timer();
      t.start();
      switch (sceneType) {
        case JAVA:
          api = SunflowAPI.compile(editorTextArea.getText());
          break;
        case SC: {
          File tmpFile = File.createTempFile("jwf", ".sc");
          try {
            String filename = tmpFile.getAbsolutePath();
            Tools.writeUTF8Textfile(filename, editorTextArea.getText());
            String template = "import org.sunflow.core.*;\nimport org.sunflow.core.accel.*;\nimport org.sunflow.core.camera.*;\nimport org.sunflow.core.primitive.*;\nimport org.sunflow.core.shader.*;\nimport org.sunflow.image.Color;\nimport org.sunflow.math.*;\n\npublic void build() {\n  include(\"" + filename.replace("\\", "\\\\") + "\");\n}\n";
            api = SunflowAPI.compile(template);
          }
          finally {
            tmpFile.deleteOnExit();
          }
        }
          break;
      }
      if (currentFile != null) {
        String dir = new File(currentFile).getAbsoluteFile().getParent();
        api.searchpath("texture", dir);
        api.searchpath("include", dir);
      }
      api.build();
      t.end();
      UI.printInfo(Module.GUI, "Build time: %s", t.toString());
      enableControls();
    }
    catch (Throwable ex) {
      api = null;
      errorHandler.handleError(ex);
View Full Code Here

Examples of org.waveprotocol.box.stat.Timer

    this.whenFinished = whenFinished;
    loadStageZero();
  }

  private void loadStageZero() {
    final Timer timer = Timing.start("Stage Zero");
    createStageZeroLoader().call(new Accessor<StageZero>() {
      @Override
      public void use(StageZero x) {
        Timing.stop(timer);
        loadStageOne(x);
View Full Code Here

Examples of org.zanata.webtrans.client.keys.Timer

                buildNativeKeyDownEvent(new Keys(Keys.ALT_KEY, KEY_CODE_X));
        mockShortcutDisplayListInteractions();
        ArgumentCaptor<AttentionModeActivationEvent> eventBusCapture =
                ArgumentCaptor.forClass(AttentionModeActivationEvent.class);

        Timer mockTimer = mock(Timer.class);
        // capture timer
        ArgumentCaptor<TimedAction> capturedTimedAction =
                ArgumentCaptor.forClass(TimedAction.class);
        when(mockTimerFactory.create(capturedTimedAction.capture()))
                .thenReturn(mockTimer);
View Full Code Here

Examples of org.zkoss.zul.Timer

   * @param event
   */
  private void doCreateDemoTimerForNotifications(Event event) {

    if (timer == null) {
      this.timer = new Timer();

      // timer doesn't work without a page as parent
      Window outerIndexWindow = (Window) Path.getComponent("/outerIndexWindow");
      this.timer.setPage(outerIndexWindow.getPage());
      // 60000 = 60 sec.
View Full Code Here

Examples of org.zoolu.tools.Timer

   void init(TransactionServerListener listener, TransactionIdentifier transaction_id, ConnectionIdentifier connaction_id)
   {  this.transaction_listener=listener;
      this.transaction_id=transaction_id;
      this.connection_id=connection_id;
      this.response=null;
      clearing_to=new Timer(SipStack.transaction_timeout,"Clearing",this);
      printLog("id: "+String.valueOf(transaction_id),LogLevel.HIGH);
      printLog("created",LogLevel.HIGH);
  
View Full Code Here

Examples of pt.opensoft.util.Timer

        final InetSocketAddress address = new InetSocketAddress(_host, _port);
        final CGISocket protocol = new CGISocket(address, CONNECT_TIMEOUT);
        protocol.setTimeout(CONNECT_TIMEOUT);
        String response = "";
        try {
          Timer timer = new Timer();
          timer.start();
          // write message request to server
          String request = (String) iterator.next();
          if (request != null) _logger.info(timer.ellapsed(), "[SENT] {" + request + "}");
          protocol.write(request);
          // read message response from server
          response = protocol.read();
          if (response != null) _logger.info(timer.ellapsed(), "[RCVD] {" + response + "}");
        } finally {
          protocol.close();
        }
      }
    } catch (IOException e) {
View Full Code Here

Examples of quicktime.app.time.Timer

/*     */   }
/*     */
/*     */   public boolean tickle(float paramFloat, int paramInt)
/*     */     throws QTException
/*     */   {
/* 584 */     Timer localTimer = getTimer();
/* 585 */     if ((localTimer.isActive()) && (this.mSpriteWorld != null)) {
/* 586 */       super.tickle(paramFloat, paramInt);
/* 587 */       if (this.invalList != null)
/* 588 */         this.invalList.tickle(paramFloat, paramInt);
/* 589 */       idle();
/* 590 */       this.frameCount += 1;
View Full Code Here

Examples of rcm.util.Timer

           
        state = CrawlEvent.STARTED;
        sendCrawlEvent (state);
       
        synchronized (crawlQueue) {           
            Timer timer = new CrawlTimer (this);
            int timeout = dp.getCrawlTimeout();
            if (timeout > 0)
                timer.set (timeout*1000, false);

            int nWorms = Math.max (dp.getMaxThreads (), 1);
            worms = new Worm[nWorms];
            for (int i=0; i<nWorms; ++i) {
                worms[i] = new Worm (this, i);
                worms[i].start ();
            }

            try {
                while (state == CrawlEvent.STARTED) {
                    if (numPagesLeft == 0) {
                        // ran out of links to crawl
                        state = CrawlEvent.STOPPED;
                        sendCrawlEvent (state);
                    }
                    else if (synchronous) {
                        // Synchronous mode.
                        // Main thread calls process() on each link
                        // in crawlQueue, in priority order.
                        Link link = (Link)crawlQueue.getMin ();
                        if (link.getStatus () == LinkEvent.DOWNLOADED)
                            process (link);
                        else
                            crawlQueue.wait ();
                    }
                    else
                        // Asynchronous crawling.
                        // Main thread does nothing but wait, while
                        // background threads call process().
                        crawlQueue.wait ();
                }
            } catch (InterruptedException e) {}

            timer.cancel ();
               
            for (int i=0; i<worms.length; ++i)
                worms[i].die ();
            if (state == CrawlEvent.PAUSED) {
                // put partly-processed links back in fetchQueue
View Full Code Here

Examples of reactor.timer.Timer

   * @return the timer.
   */
  public Timer getTimer() {
    if (null == timer.get()) {
      synchronized (timer) {
        Timer t = new HashWheelTimer();
        if (!timer.compareAndSet(null, t)) {
          t.cancel();
        }
      }
    }
    return timer.get();
  }
View Full Code Here

Examples of restx.common.metrics.api.Timer

        return namedComponent;
    }

    private <T> Optional<NamedComponent<T>> buildAndStore(Name<T> name, MachineEngine<T> engine, SatisfiedBOM satisfiedBOM) {
        logger.info("{} - building {} with {} / {}", id, name, engine, satisfiedBOM);
        Timer timer = metrics.timer("<BUILD> " + name.getSimpleName());
        Monitor monitor = timer.time();
        ComponentBox<T> box;
        try {
            box = engine.newComponent(satisfiedBOM);
        } finally {
            monitor.stop();
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.