Stopwatch function in R

前端 未结 10 1978
后悔当初
后悔当初 2020-12-08 07:27

Is there an R timer or stopwatch function similar to MATLAB\'s tic/toc?

10条回答
  •  借酒劲吻你
    2020-12-08 08:04

    A very simple equivalence with tic and toc that you could have:

    tic=proc.time()[3]
    
    ...code...
    
    toc=proc.time()[3] - tic
    

    Where the [3] is because we are interested in the third element in the vector returned by proc.time(), which is elapsed time.

提交回复
热议问题