tock: Stop timer

View source: R/tock.R

tockR Documentation

Stop timer

Description

Stop timer and write the computation in seconds since the last call of tick().

Usage

tock(txt = "", fmt = " (%.2fs). %s\n")

Arguments

txt

custom text to be displayed

fmt

character vector of format strings. It must contain exactly one %s as placeholder for txt and one numerical format, such as %f or %e, as placeholder for the time

Value

Returns the elapsed time in seconds since calling tick().

Author(s)

Danail Obreschkow

See Also

tick

Examples


tick('Sum 10 million random numbers')
x = sum(runif(1e7))
tock()


obreschkow/cooltools documentation built on Nov. 16, 2024, 2:46 a.m.