I need to save the run-time of my algorithms and after that, I'd like to have the mean value but I have a problem with the metrics. Sometimes time difference return minutes and sometimes second. How I can always obtain minutes?
This is a short example, where when I calculated the mean, there is a "bug". How I can fix it?
waitTimes <- c(50,60,70)
saveTimes <- list()
for(i in 1:length(waitTimes)){
start <- Sys.time()
Sys.sleep(waitTimes[i])
end <- Sys.time()
saveTimes[[i]] <- end - start
}
tim <- c()
for(i in 1:length(saveTimes)){
tim <- c(tim,saveTimes[[i]])
}