mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-18 01:30:27 +02:00
* time.scm (time): Reimplemented as a procedure call.
(Thanks to Marius Vollmer)
This commit is contained in:
parent
c40eb5944b
commit
3b9e23a7b6
2 changed files with 19 additions and 11 deletions
|
@ -1,3 +1,8 @@
|
|||
2001-03-20 Keisuke Nishida <kxn30@po.cwru.edu>
|
||||
|
||||
* time.scm (time): Reimplemented as a procedure call.
|
||||
(Thanks to Marius Vollmer)
|
||||
|
||||
2001-03-20 Keisuke Nishida <kxn30@po.cwru.edu>
|
||||
|
||||
* safe-r5rs.scm (list): Export.
|
||||
|
|
|
@ -21,10 +21,10 @@
|
|||
:use-module (ice-9 format)
|
||||
:export (time))
|
||||
|
||||
(define-macro (time form)
|
||||
(define (time-proc proc)
|
||||
(let* ((gc-start (gc-run-time))
|
||||
(tms-start (times))
|
||||
(result (eval form (interaction-environment)))
|
||||
(result (proc))
|
||||
(tms-end (times))
|
||||
(gc-end (gc-run-time)))
|
||||
(define (get proc start end)
|
||||
|
@ -38,3 +38,6 @@
|
|||
(get tms:cstime tms-start tms-end)
|
||||
(get id gc-start gc-end))
|
||||
result))
|
||||
|
||||
(define-macro (time exp)
|
||||
`(,time-proc (lambda () ,exp)))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue