setTimeout和setInterval有什么区别,例如,在UI进程长期运行的函数中?
setTimeout(function(){
/* Some long block of code... */
}, 10);
setInterval(function(){
/* Some long block of code... */
}, 10);
如果执行时间较长,则执行时间大于setTimeout或setInterval以设置时间。
请允许我多次调用java文件的主函数,如(100)次,并测量它完成所需的时间。目的是比较时间和其他一些文件。从字面上讲,我在实现算法。
我知道计算时间的方法是:
long startTime = System.currentTimeMillis();
GetExecutionTimes ext=new GetExecutionTimes();
ext.callMethod();
long endTime = System.currentTimeMillis();
System.out.println("Total elapsed time in execution of metho