[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Help Need: Time Function From: L66@psuvm.psu.edu
- To: info-mcl
- Subject: Re: Help Need: Time Function From: L66@psuvm.psu.edu
- From: spector@mimsy.umd.edu (Lee Spector)
- Date: 17 Jan 92 16:02:16 GMT
- Newsgroups: comp.lang.lisp.mcl
- Organization: U of Maryland, Dept. of Computer Science, Coll. Pk., MD 20742
- Posted: Fri Jan 17 10:02:16 1992
- References: <1992Jan17.135205.27426@coli.uni-sb.de>
In article <1992Jan17.135205.27426@coli.uni-sb.de> espen@coli.uni-sb.de (Espen J. Vestre) writes:
> [stuff deleted]
>"time spent in the cooperative multitasking experience". The MCL version
>of get-internal-run-time obviously works like this, but some of the Apple
>guys have to explain what exactly is included in this time. I think it
>includes time spent in GC, for instance.
I believe that it does include GC time, and I've used code like the following
to get around that. If anyone knows a better or more portable way, please post.
(defun total-ticks-spent-in-gc ()
"MCL 2.0b1p2 specific. Provided by bill@cambridge.apple.com"
(%get-long (ccl::%currenta5) -310))
(let ((run-time)
(end-time)
(gc-ticks-at-end)
(gc-ticks-at-start (total-ticks-spent-in-gc))
(start-time (get-internal-run-time)))
(setq result (funcall (the-function-I-want-to-time)))
(setq end-time (get-internal-run-time))
(setq gc-ticks-at-end (total-ticks-spent-in-gc))
(setq run-time
(- (- end-time start-time)
(- gc-ticks-at-end gc-ticks-at-start)))
...etc
-Lee (spector@cs.umd.edu)