pretty_time_taken {dfeR} | R Documentation |
Calculate elapsed time between two points and present prettily
Description
Converts a start and end value to a readable time format.
Usage
pretty_time_taken(start_time, end_time)
Arguments
start_time |
start time readable by as.POSIXct |
end_time |
end time readable by as.POSIXct |
Details
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.
Value
string containing prettified elapsed time
See Also
comma_sep()
round_five_up()
as.POSIXct()
Other prettying:
pretty_filesize()
,
pretty_num()
,
pretty_num_table()
Examples
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)
[Package dfeR version 1.0.1 Index]