62,614
社区成员
发帖
与我相关
我的任务
分享
long startTime = System.currentTimeMillis();
// TODO: 执行用户操作
long endTime = System.currentTimeMillis();
System.out.println("总计用时 "+ (endTime-startTime)+" 毫秒");
System.out.println("当前总内存:" + Runtime.getRuntime().totalMemory());
System.out.println("当前空闲内存:" + Runtime.getRuntime().freeMemory());
System.out.println("最大内存:" + Runtime.getRuntime().maxMemory());