Esempio n. 1
0
        /// <summary>Get CPU time in nanoseconds. </summary>
        static public long getCpuTime(long id)
        {
            ThreadMXBean bean = ManagementFactory.getThreadMXBean();

            if (!bean.isThreadCpuTimeSupported())
            {
                return(0L);
            }
            else
            {
                return(bean.getThreadCpuTime(id));
            }
        }