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 classTickers.TickerWithUnit
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Tickers.TickerWithUnitgetCurrentThreadCputime()Return aTickers.TickerWithUnitthat delegates toThreadMXBean.getCurrentThreadCpuTime().static Tickers.TickerWithUnitgetNullTicker()Return a dummyTickers.TickerWithUnitthat always returns 0.static Tickers.TickerWithUnitgetProcessCputime()Return aTickers.TickerWithUnitthat delegates tocom.sun.management.OperatingSystemMXBean.getProcessCpuTime().static Tickers.TickerWithUnitgetWalltimeMillis()Return aTickers.TickerWithUnitthat delegates toSystem.currentTimeMillis().static Tickers.TickerWithUnitgetWalltimeNanos()Return aTickers.TickerWithUnitthat delegates toSystem.nanoTime().
-
-
-
Method Detail
-
getNullTicker
public static Tickers.TickerWithUnit getNullTicker()
Return a dummyTickers.TickerWithUnitthat always returns 0.
-
getWalltimeMillis
public static Tickers.TickerWithUnit getWalltimeMillis()
Return aTickers.TickerWithUnitthat 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.TickerWithUnitthat delegates toSystem.nanoTime().
-
getCurrentThreadCputime
public static Tickers.TickerWithUnit getCurrentThreadCputime()
Return aTickers.TickerWithUnitthat delegates toThreadMXBean.getCurrentThreadCpuTime().- Throws:
UnsupportedOperationException- If the JVM does not support measuring per-thread CPU time.
-
getProcessCputime
public static Tickers.TickerWithUnit getProcessCputime()
Return aTickers.TickerWithUnitthat 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.
-
-