import java.lang.management.ManagementFactory; import java.lang.management.RuntimeMXBean; import java.util.Date; public class JVMStartTime { public static void main(String[] args) { // Get JVM's thread system bean RuntimeMXBean bean = ManagementFactory.getRuntimeMXBean(); // Get start time long startTime = bean.getStartTime(); // Get start Date Date startDate = new Date(startTime); // print values System.out.println("Start Time = " + startTime); System.out.println("Start Date = " + startDate); } }
原创文章,作者:Maggie-Hunter,如若转载,请注明出处:https://blog.ytso.com/10968.html