测试java代码运行时间
public class Test
{
public static void main(String[] args)
{
// long startTime = System.nanoTime(); // 纳秒级
long startTime = System.currentTimeMillis(); // 毫秒级
// 测试的代码
// long estimatedTime = System.nanoTime() - startTime;
long estimatedTime=System.currentTimeMillis() - startTime;
System.out.println(estimatedTime);
}
}
/**************************************************************************
                 
原文来自博客园——Submarinex的博客: www.cnblogs.com/submarinex/               
 
*************************************************************************/

浙公网安备 33010602011771号