I want to record my computing time for a for loop function. I write the function by rcpp, and use std::clock to measure the time interval. The rcpp code is as follow: