类 Stopwatch
- java.lang.Object
-
- net.dongliu.commons.Stopwatch
-
public class Stopwatch extends java.lang.ObjectA tool for measuring elapsed time. This class is not thread-safe.
-
-
方法概要
所有方法 静态方法 实例方法 具体方法 修饰符和类型 方法 说明 static Stopwatchcreate()Create a stopwatch, not started.java.time.Durationelapsed()Return elapsed duration.longelapsed(java.util.concurrent.TimeUnit timeUnit)Return elapsed duration as specific time unit value.longelapsedMillis()Return clasped duration as milli seconds.longelapsedNanos()Return clasped duration as nano seconds.Stopwatchstart()Start the watchStopwatchstop()Stop the stopwatch, the following calls to elapsed will return elapsed time as this time.
-
-
-
方法详细资料
-
create
public static Stopwatch create()
Create a stopwatch, not started. You may want to call start() method to start this stopwatch.
-
start
public Stopwatch start()
Start the watch
-
stop
public Stopwatch stop()
Stop the stopwatch, the following calls to elapsed will return elapsed time as this time.
-
elapsed
public java.time.Duration elapsed()
Return elapsed duration.
-
elapsed
public long elapsed(java.util.concurrent.TimeUnit timeUnit)
Return elapsed duration as specific time unit value.
-
elapsedNanos
public long elapsedNanos()
Return clasped duration as nano seconds.
-
elapsedMillis
public long elapsedMillis()
Return clasped duration as milli seconds.
-
-