Skip to contents

This function calculates the elapsed time since a given start time, formats it, and prints it with an optional message.

Usage

elapsed.time(start.time, message = "DONE", with.brackets = TRUE)

Arguments

start.time

A proc.time() object representing the start time.

message

Character string to be printed before the elapsed time. Default is "DONE".

with.brackets

Logical, if TRUE (default), the time is enclosed in parentheses.

Value

None. This function is called for its side effect of printing.

Examples

start <- proc.time()
elapsed.time(start, "Processing complete")