更新时间:2022-10-14 23:39:31
您在API文档中查找错误的位置,它位于7
I see code for jdk6 that has the following OperatingSystemMXBean method :
OperatingSystemMXBean osbean =
(OperatingSystemMXBean) ManagementFactory.getOperatingSystemMXBean();
long prevProcessCpuTime = osbean.getProcessCpuTime();
In the JDK7 docs there appears not to be any mention of them. http://docs.oracle.com/javase/7/docs/api/java/lang/management/OperatingSystemMXBean.html
Are there any equivalents to the jdk6 method elsewhere in the jdk7+ ?
You are looking at wrong place in API doc, It is there in 7