Mercurial > emacs
comparison lisp/timer.el @ 46319:534629ca4cc4
(timer-set-time-with-usecs): Fix documentation. Simplify extraction of time data.
author | Juanma Barranquero <lekktu@gmail.com> |
---|---|
date | Fri, 12 Jul 2002 11:56:30 +0000 |
parents | 88e97e81d728 |
children | ded24b27ba96 |
comparison
equal
deleted
inserted
replaced
46318:e3f0fe8c555a | 46319:534629ca4cc4 |
---|---|
135 (aset timer 1 (nth 0 time)) | 135 (aset timer 1 (nth 0 time)) |
136 (aset timer 2 (nth 1 time)) | 136 (aset timer 2 (nth 1 time)) |
137 (aset timer 3 (or (nth 2 time) 0)))) | 137 (aset timer 3 (or (nth 2 time) 0)))) |
138 | 138 |
139 (defun timer-set-time-with-usecs (timer time usecs &optional delta) | 139 (defun timer-set-time-with-usecs (timer time usecs &optional delta) |
140 "Set the trigger time of TIMER to TIME. | 140 "Set the trigger time of TIMER to TIME plus USECS. |
141 TIME must be in the internal format returned by, e.g., `current-time'. | 141 TIME must be in the internal format returned by, e.g., `current-time'. |
142 If optional third argument DELTA is a non-zero integer, make the timer | 142 The microsecond count from TIME is ignored, and USECS is used instead. |
143 If optional fourth argument DELTA is a non-zero integer, make the timer | |
143 fire repeatedly that many seconds apart." | 144 fire repeatedly that many seconds apart." |
144 (or (timerp timer) | 145 (or (timerp timer) |
145 (error "Invalid timer")) | 146 (error "Invalid timer")) |
146 (aset timer 1 (car time)) | 147 (aset timer 1 (nth 0 time)) |
147 (aset timer 2 (if (consp (cdr time)) (car (cdr time)) (cdr time))) | 148 (aset timer 2 (nth 1 time)) |
148 (aset timer 3 usecs) | 149 (aset timer 3 usecs) |
149 (aset timer 4 (and (numberp delta) (> delta 0) delta)) | 150 (aset timer 4 (and (numberp delta) (> delta 0) delta)) |
150 timer) | 151 timer) |
151 | 152 |
152 (defun timer-set-function (timer function &optional args) | 153 (defun timer-set-function (timer function &optional args) |