Package org.sosy_lab.common.time
Class Tickers
java.lang.Object
org.sosy_lab.common.time.Tickers
Class providing several convenient
Ticker implementations.-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic Tickers.TickerWithUnitReturn aTickers.TickerWithUnitthat delegates toThreadMXBean.getCurrentThreadCpuTime().static Tickers.TickerWithUnitReturn a dummyTickers.TickerWithUnitthat always returns 0.static Tickers.TickerWithUnitReturn aTickers.TickerWithUnitthat delegates tocom.sun.management.OperatingSystemMXBean.getProcessCpuTime().static Tickers.TickerWithUnitReturn aTickers.TickerWithUnitthat delegates toSystem.currentTimeMillis().static Tickers.TickerWithUnitReturn aTickers.TickerWithUnitthat delegates toSystem.nanoTime().
-
Method Details
-
getNullTicker
Return a dummyTickers.TickerWithUnitthat always returns 0. -
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
Return aTickers.TickerWithUnitthat delegates toSystem.nanoTime(). -
getCurrentThreadCputime
Return aTickers.TickerWithUnitthat delegates toThreadMXBean.getCurrentThreadCpuTime().- Throws:
UnsupportedOperationException- If the JVM does not support measuring per-thread CPU time.
-
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.
-