summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/timer.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/emacs-lisp/timer.el')
-rw-r--r--lisp/emacs-lisp/timer.el24
1 files changed, 5 insertions, 19 deletions
diff --git a/lisp/emacs-lisp/timer.el b/lisp/emacs-lisp/timer.el
index b1e12b1fd56..74d37b0eaed 100644
--- a/lisp/emacs-lisp/timer.el
+++ b/lisp/emacs-lisp/timer.el
@@ -102,14 +102,14 @@ fire each time Emacs is idle for that many seconds."
"Yield the next value after TIME that is an integral multiple of SECS.
More precisely, the next value, after TIME, that is an integral multiple
of SECS seconds since the epoch. SECS may be a fraction."
- (let* ((trillion 1e12)
+ (let* ((trillion 1000000000000)
(time-sec (+ (nth 1 time)
- (* 65536.0 (nth 0 time))))
+ (* 65536 (nth 0 time))))
(delta-sec (mod (- time-sec) secs))
- (next-sec (+ time-sec (ffloor delta-sec)))
- (next-sec-psec (ffloor (* trillion (mod delta-sec 1))))
+ (next-sec (+ time-sec (floor delta-sec)))
+ (next-sec-psec (floor (* trillion (mod delta-sec 1))))
(sub-time-psec (+ (or (nth 3 time) 0)
- (* 1e6 (nth 2 time))))
+ (* 1000000 (nth 2 time))))
(psec-diff (- sub-time-psec next-sec-psec)))
(if (and (<= next-sec time-sec) (< 0 psec-diff))
(setq next-sec-psec (+ sub-time-psec
@@ -141,20 +141,6 @@ omitted, they are treated as zero."
(setf (timer--time timer)
(timer-relative-time (timer--time timer) secs usecs psecs)))
-(defun timer-set-time-with-usecs (timer time usecs &optional delta)
- "Set the trigger time of TIMER to TIME plus USECS.
-TIME must be in the internal format returned by, e.g., `current-time'.
-The microsecond count from TIME is ignored, and USECS is used instead.
-If optional fourth argument DELTA is a positive number, make the timer
-fire repeatedly that many seconds apart."
- (declare (obsolete "use `timer-set-time' and `timer-inc-time' instead."
- "22.1"))
- (setf (timer--time timer) time)
- (setf (timer--usecs timer) usecs)
- (setf (timer--psecs timer) 0)
- (setf (timer--repeat-delay timer) (and (numberp delta) (> delta 0) delta))
- timer)
-
(defun timer-set-function (timer function &optional args)
"Make TIMER call FUNCTION with optional ARGS when triggering."
(timer--check timer)