Package org.sosy_lab.common.time
Class Tickers
- java.lang.Object
-
- org.sosy_lab.common.time.Tickers
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Tickers.TickerWithUnit
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Tickers.TickerWithUnit
getCurrentThreadCputime()
Return aTickers.TickerWithUnit
that delegates toThreadMXBean.getCurrentThreadCpuTime()
.static Tickers.TickerWithUnit
getNullTicker()
Return a dummyTickers.TickerWithUnit
that always returns 0.static Tickers.TickerWithUnit
getProcessCputime()
Return aTickers.TickerWithUnit
that delegates tocom.sun.management.OperatingSystemMXBean.getProcessCpuTime()
.static Tickers.TickerWithUnit
getWalltimeMillis()
Return aTickers.TickerWithUnit
that delegates toSystem.currentTimeMillis()
.static Tickers.TickerWithUnit
getWalltimeNanos()
Return aTickers.TickerWithUnit
that delegates toSystem.nanoTime()
.
-
-
-
Method Detail
-
getNullTicker
public static Tickers.TickerWithUnit getNullTicker()
Return a dummyTickers.TickerWithUnit
that always returns 0.
-
getWalltimeMillis
public static Tickers.TickerWithUnit getWalltimeMillis()
Return aTickers.TickerWithUnit
that delegates toSystem.currentTimeMillis()
. Note that the returned instance validates the contract of Ticker because it provides values in milliseconds, not in nanoseconds.
-
getWalltimeNanos
public static Tickers.TickerWithUnit getWalltimeNanos()
Return aTickers.TickerWithUnit
that delegates toSystem.nanoTime()
.
-
getCurrentThreadCputime
public static Tickers.TickerWithUnit getCurrentThreadCputime()
Return aTickers.TickerWithUnit
that delegates toThreadMXBean.getCurrentThreadCpuTime()
.- Throws:
UnsupportedOperationException
- If the JVM does not support measuring per-thread CPU time.
-
getProcessCputime
public static Tickers.TickerWithUnit getProcessCputime()
Return aTickers.TickerWithUnit
that delegates tocom.sun.management.OperatingSystemMXBean.getProcessCpuTime()
. This is available on Sun/Oracle/OpenJDK JVM for Linux, but not guaranteed on other platforms.- Throws:
UnsupportedOperationException
- If the JVM does not support measuring process CPU time.
-
-