use of java.lang.management.RuntimeMXBean in project Payara by payara.
the class LocationsCommand method getUptime.
private long getUptime() {
RuntimeMXBean mxbean = ManagementFactory.getRuntimeMXBean();
long totalTime_ms = -1;
if (mxbean != null)
totalTime_ms = mxbean.getUptime();
if (totalTime_ms <= 0) {
long start = env.getStartupContext().getCreationTime();
totalTime_ms = System.currentTimeMillis() - start;
}
return totalTime_ms;
}
use of java.lang.management.RuntimeMXBean in project Payara by payara.
the class UptimeCommand method getUptime.
private long getUptime() {
RuntimeMXBean mxbean = ManagementFactory.getRuntimeMXBean();
long totalTime_ms = -1;
if (mxbean != null)
totalTime_ms = mxbean.getUptime();
if (totalTime_ms <= 0) {
long start = env.getStartupContext().getCreationTime();
totalTime_ms = System.currentTimeMillis() - start;
}
return totalTime_ms;
}
Aggregations