我想测试某些代码块的运行时间如下:
start = System.currentTimeMillis();
{
...
this.dosomething();
}
end = System.currentTimeMillis();
System.out.println(end - start);
当我优化代码块时,如何注释那些快速计算时间的代码,如下所示?
//start = System.currentTimeMillis();
{
...
this.dosomething();
}
//end = System.currentTimeMillis();
//System.out.println(end - start);