R: 自動計算代碼運行時間

###################################################spa

問題:代碼運行時間   18.4.25

         怎麼計算代碼的運行時間?orm

解決方案:擴展

         ptm = proc.time();   ptmim

         statements時間

         proc.time() - ptm解決方案

討論擴展:co

         ptm <- proc.time()time

         for (i in 1:10000) x <- rnorm(1000)background

         proc.time()-ptm

         system.time(for (i in 1:100000) x <- rnorm(1000))

另請參閱:

相關文章
相關標籤/搜索