* Processor time used by Emacs
@ 2003-10-29 13:02 Lars Brinkhoff
2003-10-29 15:58 ` Dan Anderson
0 siblings, 1 reply; 4+ messages in thread
From: Lars Brinkhoff @ 2003-10-29 13:02 UTC (permalink / raw)
Is there a way in Emacs Lisp to find out the amount of processor time
(perhaps separated into user/system time) spent by Emacs?
For example, if there was such a function called processor-time, this
should return (close to) 0:
(let ((start (processor-time)))
(sleep-for 10)
(- (processor-time) start))
, whereas current-time would indicate that ten seconds passed
sleeping.
--
Lars Brinkhoff, Services for Unix, Linux, GCC, HTTP
Brinkhoff Consulting http://www.brinkhoff.se/
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Processor time used by Emacs
[not found] <mailman.2705.1067432711.21628.help-gnu-emacs@gnu.org>
@ 2003-10-29 13:16 ` David Kastrup
2003-10-29 14:05 ` Lars Brinkhoff
0 siblings, 1 reply; 4+ messages in thread
From: David Kastrup @ 2003-10-29 13:16 UTC (permalink / raw)
Lars Brinkhoff <lars@nocrew.org> writes:
> Is there a way in Emacs Lisp to find out the amount of processor time
> (perhaps separated into user/system time) spent by Emacs?
>
> For example, if there was such a function called processor-time, this
> should return (close to) 0:
>
> (let ((start (processor-time)))
> (sleep-for 10)
> (- (processor-time) start))
>
> , whereas current-time would indicate that ten seconds passed
> sleeping.
(let ((start (current-time)))
(sleep-for 10)
(float-time (time-since start)))
--
David Kastrup, Kriemhildstr. 15, 44793 Bochum
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Processor time used by Emacs
2003-10-29 13:16 ` David Kastrup
@ 2003-10-29 14:05 ` Lars Brinkhoff
0 siblings, 0 replies; 4+ messages in thread
From: Lars Brinkhoff @ 2003-10-29 14:05 UTC (permalink / raw)
David Kastrup <dak@gnu.org> writes:
> > Is there a way in Emacs Lisp to find out the amount of processor time
> > (perhaps separated into user/system time) spent by Emacs?
> >
> > For example, if there was such a function called processor-time, this
> > should return (close to) 0:
> >
> > (let ((start (processor-time)))
> > (sleep-for 10)
> > (- (processor-time) start))
> >
> > , whereas current-time would indicate that ten seconds passed
> > sleeping.
>
> (let ((start (current-time)))
> (sleep-for 10)
> (float-time (time-since start)))
That would return (about) 10.0, right? If so, time-since is not what
I need.
(My version of Emacs (20.7) doesn't have time-since, but I guess it's
the time-since function from Gnus.)
--
Lars Brinkhoff, Services for Unix, Linux, GCC, HTTP
Brinkhoff Consulting http://www.brinkhoff.se/
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Processor time used by Emacs
2003-10-29 13:02 Processor time used by Emacs Lars Brinkhoff
@ 2003-10-29 15:58 ` Dan Anderson
0 siblings, 0 replies; 4+ messages in thread
From: Dan Anderson @ 2003-10-29 15:58 UTC (permalink / raw)
Cc: help-gnu-emacs
I don't know enough elisp to help you, but if you could execute a shell
command you could get the info simple enough:
% ps ax | grep emacs
Then use a pipe or file to a program or file you want emacs to read
from.
-Dan
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2003-10-29 15:58 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-10-29 13:02 Processor time used by Emacs Lars Brinkhoff
2003-10-29 15:58 ` Dan Anderson
[not found] <mailman.2705.1067432711.21628.help-gnu-emacs@gnu.org>
2003-10-29 13:16 ` David Kastrup
2003-10-29 14:05 ` Lars Brinkhoff
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).