Sorry for the late response - missed this for a while.

That's still much more slow than not doing it - slightly modifying your
example,:

(progn
  (setq start (current-time))
  (let ((row 0) (log (time-add (current-time) '(0 1 0 0))))
    (while (< row 6543210)
      (setq row (1+ row))
      (when (time-less-p log (current-time))
        (setq log (time-add (current-time) '(0 1 0 0)))
        (message "row %d" row))))
  (setq end (current-time))
  (print (time-subtract end start)))

prints (0 43 386499 0) on my computer.

Removing the when clause:

(progn
  (setq start (current-time))
  (let ((row 0) (log (time-add (current-time) '(0 1 0 0))))
    (while (< row 6543210)
      (setq row (1+ row))))
  (setq end (current-time))
  (print (time-subtract end start)))

Results in:
(0 1 277641 0)

So adding the logging here slows it down by about 43x - It doesn't seem
worth it.

On Sun, Aug 17, 2014 at 6:39 AM, Michael Brand <michael.ch.br...@gmail.com>
wrote:

> Hi Nathaniel
>
> On Thu, Aug 7, 2014 at 4:57 PM, Nathaniel Flath <flat0...@gmail.com>
> wrote:
> > I'd be fine with displaying every
> > second, but I don't see a good way of doing this - do you have any
> > suggestions?
>
> I thought of something like in this example:
>
> (let ((row 0) (log (time-add (current-time) '(0 1 0 0))))
>   (while (< row 6543210)
>     (setq row (1+ row))
>     (when (time-less-p log (current-time))
>       (setq log (time-add (current-time) '(0 1 0 0)))
>       (message "row %d" row))))
>
> Michael
>

Reply via email to