pretty_time_taken | R Documentation |
Converts a start and end value to a readable time format.
pretty_time_taken(start_time, end_time)
start_time |
start time readable by as.POSIXct |
end_time |
end time readable by as.POSIXct |
Designed to be used with Sys.time() when tracking start and end times.
Shows as seconds up until 119 seconds, then minutes until 119 minutes, then hours for anything larger.
Input start and end times must be convertible to POSIXct format.
string containing prettified elapsed time
comma_sep()
round_five_up()
as.POSIXct()
Other prettying:
pretty_filesize()
,
pretty_num()
,
pretty_num_table()
pretty_time_taken(
"2024-03-23 07:05:53 GMT",
"2024-03-23 12:09:56 GMT"
)
# Track the start and end time of a process
start <- Sys.time()
Sys.sleep(0.1)
end <- Sys.time()
# Use this function to present it prettily
pretty_time_taken(start, end)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.