all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Arthur Miller <arthur.miller@live.com>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: 52235@debbugs.gnu.org
Subject: bug#52235: 29.0.50; Suggestion: refactor time.el into a more general 'clock' framework
Date: Fri, 03 Dec 2021 00:36:37 +0100	[thread overview]
Message-ID: <AM9PR09MB4977EBF3E26221127F2DFAA096699@AM9PR09MB4977.eurprd09.prod.outlook.com> (raw)
In-Reply-To: <87wnkn5o1j.fsf@gnus.org> (Lars Ingebrigtsen's message of "Thu, 02 Dec 2021 10:55:20 +0100")

Lars Ingebrigtsen <larsi@gnus.org> writes:

> Arthur Miller <arthur.miller@live.com> writes:
>
>>> If I understand correctly, by "clock beat" you mean an integer multiple
>>> of some time?
>> I am not sure if we speak about same thing; but I mean the clock, synchronized
>> with what Emacs shows as time.
>
> I'm not sure either, because I'm not sure what you mean by
> "synchronized".  But if you want a timer to run at 11:01:00, 11:02:00,
> 11:03:00, then timer.el has support for that (and calls that "integer
> multiple").

Ok. I have tried it now; it seems to work :). TBH I didn't realize what "integer
multiple of REPEAT" means in this aspect, so I didn't even use 't option, and I
also wanted it to start immidiately so I thought I wanted 'nil = meaning now
option. I don't know, blame it on my english, but I found that one tricky to
understand doc.

I don't know if I can suggest better wording myself, but maybe it might help
someone else one day, if that last option was reworded somehow. I think people
usually use term "wall clcok" in this context, but I am not sure, I am not
native english speaker, but I think I have encountered that term in std c++ docs
and Java docs.

>> Also there is no read to run several timers when one timer could
>> be fine to run several hooks as well as saving some code repetition.
>
> Running several timers is fine.  And I don't think there's any code
> repetition?  Just say
>
> (run-at-time t 60 (lambda () (message (format-time-string "%H:%M:%S"))))
>
> or whatever you want.

I guess timers are not very expensive resource in a system, no idea actually how
memory/cpu costly (or cheaply) they are, but it is just that I have to
keep track of it to cancel it when I am done to not leak resource.

By now I am also used to "hooks" in Emacs, and Emacs acting as a framework in
many cases, so it kind of suits my mental build better to add a function to a
hook and get it called than have to setup this manually.

Anyway, this was a suggestion and thanks for the clarification about integer
multiple in this context :-).





  reply	other threads:[~2021-12-02 23:36 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <DB9PR09MB49867F87628009D4F53B756E96689@DB9PR09MB4986.eurprd09.prod.outlook.com>
2021-12-02  7:26 ` bug#52235: 29.0.50; Suggestion: refactor time.el into a more general 'clock' framework Eli Zaretskii
2021-12-02  9:19   ` Arthur Miller
2021-12-02  9:55     ` Eli Zaretskii
2021-12-02 23:48       ` Arthur Miller
2021-12-02  8:29 ` Lars Ingebrigtsen
2021-12-02  9:28   ` Arthur Miller
2021-12-02  9:55     ` Lars Ingebrigtsen
2021-12-02 23:36       ` Arthur Miller [this message]
2021-12-03 16:23         ` Lars Ingebrigtsen
2021-12-03  0:52       ` Stefan Kangas
2021-12-03  7:26         ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AM9PR09MB4977EBF3E26221127F2DFAA096699@AM9PR09MB4977.eurprd09.prod.outlook.com \
    --to=arthur.miller@live.com \
    --cc=52235@debbugs.gnu.org \
    --cc=larsi@gnus.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.