I need to get execution time in milliseconds. (我需要获取执行时间(以毫秒为单位)。)
ask by Julius A translate from soI originally asked this question back in 2008. The accepted answer then was to use new Date().getTime() However, we can all agree now that using the standard performance.now() API is more appropriate. (我最初是在2008年问这个问题的。当时接受的答案是使用new Date()。getTime()。但是,我们现在都同意使用标准performance.now() API更合适。) I am therefore changing the accepted answer to this one. (因此,我正在改变对此的公认答案。)