Skip to contents

Creates a timer object with methods for tracking elapsed time across execution phases.

Usage

make_timer()

Value

A list with the following methods:

  • start() - Start or restart the timer

  • stop() - Stop the timer

  • elapsed() - Get elapsed time in seconds

Examples

timer <- make_timer()
timer$start()
Sys.sleep(0.1)
timer$stop()
timer$elapsed()
#> [1] 0.1015334