本文整理汇总了Java中org.apache.commons.lang3.time.StopWatch.suspend方法的典型用法代码示例。如果您正苦于以下问题:Java StopWatch.suspend方法的具体用法?Java StopWatch.suspend怎么用?Java StopWatch.suspend使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.commons.lang3.time.StopWatch
的用法示例。
在下文中一共展示了StopWatch.suspend方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: constructSuspendedStopWatch
import org.apache.commons.lang3.time.StopWatch; //导入方法依赖的package包/类
/**
* Construct a stop watch that has been started and suspended.
*
* @return The stop watch
*/
private StopWatch constructSuspendedStopWatch() {
StopWatch dropsStopwatch = new StopWatch();
dropsStopwatch.start();
dropsStopwatch.suspend();
return dropsStopwatch;
}
示例2: stop
import org.apache.commons.lang3.time.StopWatch; //导入方法依赖的package包/类
/**
* Stop the timer for the given point.
*
* @param point
*/
public void stop(TimingPoint point) {
StopWatch stopWatch = map.get(point);
stopWatch.suspend();
stateMap.put(point, StopWatchState.STOPPED);
}
示例3: pauseTimer
import org.apache.commons.lang3.time.StopWatch; //导入方法依赖的package包/类
/**
* Pauses named timer (stopping measurement), can be resumed later.
* @param name name of timer to pause.
* @return time in milliseconds since timer was started.
*/
public long pauseTimer(String name) {
StopWatch sw = getStopWatch(name);
sw.suspend();
return sw.getTime();
}