| java.lang.Object org.netbeans.lib.profiler.server.system.Timers
Timers | public class Timers (Code) | | Provides methods for obtaining various high-resolution system times.
A version for JDK 1.5
author: Misha Dmitriev |
Method Summary | |
native public static void | enableMicrostateAccounting(boolean v) This is relevant only on Solaris. | public static long | getCurrentTimeInCounts() "counts" instead of nanoseconds in this method are for compatibility with the previous
versions of JFluid, that call a native method for system timer, which, in turn, returns
the result in sub-microsecond "counts" on Windows. | public static long | getNoOfCountsInSecond() | native public static long | getThreadCPUTimeInNanos() | public static void | initialize() | native public static void | osSleep(int ns) WORKS ONLY ON UNIX, calls nanosleep(). |
enableMicrostateAccounting | native public static void enableMicrostateAccounting(boolean v)(Code) | | This is relevant only on Solaris. By default, the resolution of the thread local CPU timer is 10 ms. If we enable
micro state accounting, it enables significantly (but possibly at a price of some overhead). So I turn it on only
when thread CPU timestamps are really collected.
|
getCurrentTimeInCounts | public static long getCurrentTimeInCounts()(Code) | | "counts" instead of nanoseconds in this method are for compatibility with the previous
versions of JFluid, that call a native method for system timer, which, in turn, returns
the result in sub-microsecond "counts" on Windows.
|
getNoOfCountsInSecond | public static long getNoOfCountsInSecond()(Code) | | |
getThreadCPUTimeInNanos | native public static long getThreadCPUTimeInNanos()(Code) | | |
initialize | public static void initialize()(Code) | | Should be called at earliest possible time
|
osSleep | native public static void osSleep(int ns)(Code) | | WORKS ONLY ON UNIX, calls nanosleep(). On Solaris, this is more precise than the built-in Thread.sleep() call
implementation that, at least in JDK 1.4.2, goes to select(3C). On Linux, it should be more precise, but it
turns out that nanosleep() in this OS, at least in version 7.3 that I tested, has a resolution of at least 20ms.
This seems to be a known issue; hopefully they fix it in future.
|
|
|