>>>> "Katsumi" == Katsumi Yamaoka
<yamaoka(a)jpl.org> writes:
Hi Katsumi,
(defun nnheader-xmas-run-at-time (time repeat function &rest args)
(start-itimer
"nnheader-run-at-time"
`(lambda ()
(,function ,@args))
time repeat))
seems to be buggy.
It does not pass args as required by start-itimer documentation of
21.5-b16.
I have slightly modified your test-case and added one using
start-itimer and both seem to perform similar here in (emacs-version)
"XEmacs 21.5 (beta16) \"celeriac\" [Lucid] (i586-pc-win32, Mule) of
Mon Nov 10 2003 on D5DC120J"
;;; Adrian's modified version, reporting requested timer value:
(defun test-timer (second)
(interactive "nSecond: ")
(let ((start (current-time)))
(run-at-time
second nil
(lambda (start second)
(let ((end (current-time)))
(message "Requested: %f, Lapsed: %f"
second
(+ (* (- (car end) (car start)) 65536)
(- (nth 1 end) (nth 1 start))
(/ (- (nth 2 end) (nth 2 start)) 1000000.0)))))
start second)))
;;; Adrian's version using start-itimer:
(defun test-timer-si (second)
(interactive "nSecond: ")
(let ((start (current-time)))
(start-itimer
"test-timer-si"
(function
(lambda (start second)
(let ((end (current-time)))
(message "Requested: %f, Lapsed: %f"
second
(+ (* (- (car end) (car start)) 65536)
(- (nth 1 end) (nth 1 start))
(/ (- (nth 2 end) (nth 2 start)) 1000000.0))))))
second
nil
nil
t
start second)))
>>>> In <873cbutif5.fsf(a)tleepslib.sk.tsukuba.ac.jp>
>>>>> "Stephen J. Turnbull" <stephen(a)xemacs.org> wrote:
> The timer.el emulation package is pretty junky, I think.
> In XEmacs the native itimer interface should be more reliable.
Katsumi> Thanks. In Gnus, there is nnheader-xmas-run-at-time which uses
Katsumi> start-itimer. So far it is good enough to Gnus even if it is
Katsumi> particular to the argument types, for instance:
Katsumi> (nnheader-xmas-run-at-time 1 nil 'ignore (current-time))
Katsumi> => itimer "nnheader-run-at-time" signaled: (invalid-function
16341)
Katsumi> It should be improved in the future, probably.
Katsumi> --
Katsumi> Katsumi Yamaoka <yamaoka(a)jpl.org>
--
Adrian Aichner
mailto:adrian@xemacs.org
http://www.xemacs.org/