timeFormat: Displays time differences in a well-arranged manner

View source: R/timeFormat.R

timeFormatR Documentation

Displays time differences in a well-arranged manner

Description

This function is primarily intended as a helper function for the eatRep and eatModel packages and adjusts the display of time differences to the seconds, minutes, or hours format, depending on the length. Hence, the function allows for clearer display of time differences according to Sys.time.

Usage

timeFormat(timediff, digits)

Arguments

timediff

The object returned by two differences of Sys.time objects

digits

number of digits for rounding. If missing, values less than 0.05 are rounded to three decimal places, and values greater than 0.05 are rounded to one decimal place.

Value

A numeric vector

Examples

begin <- Sys.time()
Sys.sleep(0.15)
message(paste0("Time during system was sleeping: ", timeFormat(Sys.time() - begin)))

eatTools documentation built on Nov. 28, 2026, 5:06 p.m.