1 public class systemdemo {
2 public static void main(String[] args) {
3 long startTime=System.currentTimeMillis();
4 int sum=0;
5 for(int i=0;i<999999999;i++){
6 sum+=i;
7 }
8 long endTime=System.currentTimeMillis();
9 System.out.println("Time cost:"+(endTime-startTime)+"millis");
10 }
11 }