tock {cooltools}R 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()


[Package cooltools version 2.4 Index]