I am running a naive bayes classifcation algorithm in R. I want to calculate the execution time of the algorithm. Shall i use
Start_time <- proc.time()
{
#execution of naive bayes classifier
}
End_time <- proc_time()
Exec_time = End_time - Start_time
to find the execution time. Is it the right way to calculate the execution time of an algorithm?