Java examples for java.lang.management:MemoryMXBean
Get user time in nanoseconds via Management bean
//package com.java2s; import java.lang.management.ManagementFactory; import java.lang.management.ThreadMXBean; public class Main { /** Get user time in nanoseconds. */ public static long getUserTime() { ThreadMXBean bean = ManagementFactory.getThreadMXBean(); return bean.isCurrentThreadCpuTimeSupported() ? bean .getCurrentThreadUserTime() : 0L; }/*from www . ja v a 2 s . c om*/ }