Learn R Programming

reproducible (version 3.2.1)

.formatDuration: Format a duration in seconds as a compact human-readable string

Description

Internal helper for download progress reporting: 90 -> "1m30s", 3725 -> "1h02m05s", 5 -> "5s". A non-finite or negative input (e.g. an ETA before there is any signal) returns "--".

Usage

.formatDuration(secs)

Value

A length-one character string.

Arguments

secs

Numeric, seconds.