简单地测试程序运行时间

import java.util.Date;

public class Timer {
/**
* @author   RainyLiu
* date:20090204
*/
public static void main(String[] args) {
   long startTime = new Date().getTime();
/*
* here you add the codes( which you want to know the times it runs)
*/
   long endTime = new Date().getTime();
   System.out.println("It runs -> " + (endTime - startTime)  + " ms" );
}

}

你可能感兴趣的:(java)