org.apache.commons.lang.time.StopWatch.resume()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(2.3k)|赞(0)|评价(0)|浏览(124)

本文整理了Java中org.apache.commons.lang.time.StopWatch.resume()方法的一些代码示例,展示了StopWatch.resume()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。StopWatch.resume()方法的具体详情如下:
包路径:org.apache.commons.lang.time.StopWatch
类名称:StopWatch
方法名:resume

StopWatch.resume介绍

[英]Resume the stopwatch after a suspend.

This method resumes the watch after it was suspended. The watch will not include time between the suspend and resume calls in the total time.
[中]暂停后恢复秒表。
此方法会在暂停后恢复手表。手表将不包括暂停和恢复通话之间的总时间。

代码示例

代码示例来源:origin: com.twitter.common/util

public void resume() {
 if (!_started) {
  start();
 } else {
  super.resume();
 }
}

代码示例来源:origin: org.zaproxy/zap

public void start(StructuralNode node) {
  if (stopWatchStarted) {
    stopWatch.resume();
  } else {
    stopWatch.start();
    stopWatchStarted = true;
  }
  try {
    inOrderAnalyse(node);
  } finally {
    stopWatch.suspend();
  }
}

代码示例来源:origin: stackoverflow.com

StopWatch stopWatch = new StopWatch();
stopWatch.start();
...
stopWatch.suspend();
...
stopWatch.resume();
...
stopWatch.stop():

long elapsed = stopWatch.getTime();

代码示例来源:origin: NationalSecurityAgency/datawave

stats.getTimer(TIMERS.SCANNER_START).resume();
try {
  if (null != stats) {
    stats.getTimer(TIMERS.SCANNER_ITERATE).resume();

代码示例来源:origin: de.tudarmstadt.ukp.dkpro.teaching/de.tudarmstadt.ukp.dkpro.teaching.frequency

public static void main(String[] args) throws Exception
  {
    Web1TProvider web1t = new Web1TProvider(new Locale("de"), 1);
    BrownCorpus brown = new BrownCorpus();
    
    StopWatch watch = new StopWatch();
    watch.start();
    watch.suspend();

    for (Text text : brown.getTexts()) {
      for (Sentence s : text.getSentences()) {
        for (String t : s.getTokens()) {
          watch.resume();
          web1t.getFrequency(t);
          watch.suspend();
        }
      }
    }
    
    double time = (double) watch.getTime() / 1000;
    System.out.println(time + "s");
  }
}

代码示例来源:origin: NationalSecurityAgency/datawave

stats.getTimer(TIMERS.SCANNER_START).resume();
try {
  if (null != stats)
    stats.getTimer(TIMERS.SCANNER_ITERATE).resume();
  retrievalCount = scannerInvariant(iter);
} finally {

代码示例来源:origin: NationalSecurityAgency/datawave

myStats.getTimer(TIMERS.SCANNER_START).resume();
delegatedResource = delegatorReference.getScannerResource();
if (log.isTraceEnabled())
  myStats.getTimer(TIMERS.SCANNER_ITERATE).resume();
while (iter.hasNext()) {
  if (!continueMultiScan)

代码示例来源:origin: NationalSecurityAgency/datawave

stats.getTimer(TIMERS.HASNEXT).resume();

代码示例来源:origin: NationalSecurityAgency/datawave

stats.getTimer(TIMERS.HASNEXT).resume();

相关文章