qtbase (version 1.1.0)

qtimer: Register a timer task

Description

A convenience function for creating a QTimer object and registering and R handler that is fired after a specified delay. The timer continues to fire until it is stopped. This does not work yet.

Usage

qtimer(delay, handler)

Arguments

delay
The delay, in milliseconds.
handler
The R function to fire after the delay.

Value

  • A QTimer object. To stop it, call the stop method.

Examples

Run this code
timer <- qtimer(2000, function() {
  print("time out")
})
timer$singleShot <- TRUE
timer$start()

Run the code above in your browser using DataCamp Workspace