/*获取系统信息*/
public class SyatemDemo {
public static void main(String[] args) {
// TODO Auto-generated method stub
System.getProperties().list(System.out); //列出系统的全部属性
long startTime = System.currentTimeMillis();
String str = "Hello";
for(int i=0; i<1000; i++){
for(int j=0; j<10; j++){
str = str + i;
}
}
long endTime = System.currentTimeMillis();
System.out.println(endTime);
System.out.println((endTime-startTime)+"毫秒"); //输出程序执行时间
System.out.println("操作系统:"+System.getProperty("os.name"));
System.out.println("操作系统版本:"+System.getProperty("os.version"));
System.out.println("系统是多少位的:"+System.getProperty("os.arch"));
System.out.println("系统当前用户:"+System.getProperty("user.name"));
System.out.println("系统用户工作目录:"+System.getProperty("user.dir"));
}
}
public class SyatemDemo {
public static void main(String[] args) {
// TODO Auto-generated method stub
System.getProperties().list(System.out); //列出系统的全部属性
long startTime = System.currentTimeMillis();
String str = "Hello";
for(int i=0; i<1000; i++){
for(int j=0; j<10; j++){
str = str + i;
}
}
long endTime = System.currentTimeMillis();
System.out.println(endTime);
System.out.println((endTime-startTime)+"毫秒"); //输出程序执行时间
System.out.println("操作系统:"+System.getProperty("os.name"));
System.out.println("操作系统版本:"+System.getProperty("os.version"));
System.out.println("系统是多少位的:"+System.getProperty("os.arch"));
System.out.println("系统当前用户:"+System.getProperty("user.name"));
System.out.println("系统用户工作目录:"+System.getProperty("user.dir"));
}
}

923

被折叠的 条评论
为什么被折叠?



