unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
* how do you time the execution of a form?
@ 2007-11-30  7:17 Marco Maggi
  2007-11-30  8:57 ` Ludovic Courtès
  0 siblings, 1 reply; 3+ messages in thread
From: Marco Maggi @ 2007-11-30  7:17 UTC (permalink / raw)
  To: guile-user

Ciao,

is there a procedure that prints the execution time of a form?
Something like:

(time-this (the-form) 1000)
;; run (the-form) 1000 times and prints the result

--
Marco Maggi

"Now feel the funk blast!"
Rage Against the Machine - "Calm like a bomb"




_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-user


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: how do you time the execution of a form?
  2007-11-30  7:17 how do you time the execution of a form? Marco Maggi
@ 2007-11-30  8:57 ` Ludovic Courtès
  2007-12-05 22:45   ` Andy Wingo
  0 siblings, 1 reply; 3+ messages in thread
From: Ludovic Courtès @ 2007-11-30  8:57 UTC (permalink / raw)
  To: guile-user

Hi,

"Marco Maggi" <marco.maggi-ipsu@poste.it> writes:

> is there a procedure that prints the execution time of a form?
> Something like:
>
> (time-this (the-form) 1000)
> ;; run (the-form) 1000 times and prints the result

In Guile-Library, there's `(debugging time)', which exports `time', a
macro that does exactly what you want.

Thanks,
Ludovic.



_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-user


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: how do you time the execution of a form?
  2007-11-30  8:57 ` Ludovic Courtès
@ 2007-12-05 22:45   ` Andy Wingo
  0 siblings, 0 replies; 3+ messages in thread
From: Andy Wingo @ 2007-12-05 22:45 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guile-user

Hi,

On Fri 30 Nov 2007 09:57, ludo@gnu.org (Ludovic Courtès) writes:

> "Marco Maggi" <marco.maggi-ipsu@poste.it> writes:
>
>> is there a procedure that prints the execution time of a form?
>> Something like:
>>
>> (time-this (the-form) 1000)
>> ;; run (the-form) 1000 times and prints the result
>
> In Guile-Library, there's `(debugging time)', which exports `time', a
> macro that does exactly what you want.

Docs for that form: http://home.gna.org/guile-lib/doc/ref/debugging.time/

Also, as it turns out (of course I only knew this after I added time to
guile-lib), there is (ice-9 time):

;;; Commentary:

;; This module exports a single macro: `time'.
;; Usage: (time exp)
;;
;; Example:
;; guile> (time (sleep 3))
;; clock utime stime cutime cstime gctime
;; 3.01  0.00  0.00   0.00   0.00   0.00
;; 0

Regards,

Andy
-- 
http://wingolog.org/


_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-user


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-12-05 22:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-30  7:17 how do you time the execution of a form? Marco Maggi
2007-11-30  8:57 ` Ludovic Courtès
2007-12-05 22:45   ` Andy Wingo

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).