java 中 System

package cn.zhou.com;
/*
 * System 类
 * 
 * 不能实列化
 * 
 * long t=System.currentTimeMillis();//用于计算程序的执行时间!
 * 
 * long end=System.currentTimeMillis();//结束!
 * 
 * exit();退出虚拟机!
 * 
 * 
 */
public class SystemDemo {
    public static void main(String[] args) {
        currentTimeMllllsDemo();
    }
    public static void currentTimeMllllsDemo(){
        long t=System.currentTimeMillis();//用于计算程序的执行时间!
        for (int i = 0; i < 3000; i++) {
            System.out.println(i);
        }
        long end=System.currentTimeMillis();
        System.out.println((end-t)+"毫秒");
    }
}

猜你喜欢

转载自www.cnblogs.com/ZXF6/p/10571305.html
今日推荐