Learn R Programming

NNbenchmark (version 3.2.0)

timestart: Collect the difftime between two events

Description

timestart starts the timer and saved the value in an object named time0 stored in .GlobalEnv.

timediff stops the timer, remove the time0 objet from .GlobalEnv and prints the duration in seconds between the two events.

timestart and timediff are fully independant from the R6 class timeR and the objects createTimer or getTimer. They use proc.time instead.

Usage

timestart()

timediff()

Arguments

Value

A single numeric value that represents a duration in seconds.

Examples

Run this code
# NOT RUN {
timestart()
Sys.sleep(2)
timediff()

# }

Run the code above in your browser using DataLab