[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Help Need: Time Function From: L66@psuvm.psu.edu

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

 -Lee (spector@cs.umd.edu)