Function: run-with-timer

run-with-timer is an interactive and byte-compiled function defined in timer.el.gz.

Signature

(run-with-timer SECS REPEAT FUNCTION &rest ARGS)

Documentation

Perform an action after a delay of SECS seconds.

Repeat the action every REPEAT seconds, if REPEAT is non-nil. SECS and REPEAT may be integers or floating point numbers. REPEAT, if non-nil, must be a non-negative number. The action is to call FUNCTION with arguments ARGS.

This function returns a timer object which you can use in cancel-timer.

View in manual

Probably introduced at or before Emacs version 19.31.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/emacs-lisp/timer.el.gz
(defun run-with-timer (secs repeat function &rest args)
  "Perform an action after a delay of SECS seconds.
Repeat the action every REPEAT seconds, if REPEAT is non-nil.
SECS and REPEAT may be integers or floating point numbers.
REPEAT, if non-nil, must be a non-negative number.
The action is to call FUNCTION with arguments ARGS.

This function returns a timer object which you can use in `cancel-timer'."
  (interactive "sRun after delay (seconds): \nNRepeat interval: \naFunction: ")
  (apply #'run-at-time secs repeat function args))