Skip to content

timetaken() could have more formatting options #7708

@jan-swissre

Description

@jan-swissre

timetaken is very handy function for formatting time taken in R code. It is currently limited to one type of format:

t0 = proc.time()
Sys.sleep(5)
timetaken(t0)
#[1] "5.007s elapsed (0.060s cpu)"

# then when something takes much longer
#[1] "01:01:33 elapsed (01:00:01 cpu)"

I would like to be able to tweak its format.
For example I would like to skip "cpu" time: "5.007s elapsed" / "01:01:33 elapsed"
Or skip elapsed word as well: "5.007s" / "01:01:33"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions