# time difference example showing results in seconds
# Sys.sleep(20) creates a pause of 20 seconds
my_time <- Sys.time()
Sys.sleep(20)
my_next_time <- Sys.time()
difftime(my_time, my_next_time, units = "secs")
If you search for date & time variables in R you will see there are several classes. You'll have to map the features vs complexity for each type compared to what you are trying to accomplish.