Scheme 中是否存在与 Lisp 的"runtime"原语等价的词汇表?

According to SICP section 1.2.6, exercise 1.22:

Most Lisp implementations include a primitive called runtime that returns an integer that specifies the amount of time the system has been running (measured, for example, in microseconds).

I'm using DrScheme, where runtime doesn't seem to be available, so I'm looking for a good substitute. I found in the PLT-Scheme Reference that there is a current-milliseconds primitive. Does anyone know if there's a timer in Scheme with better resolution?

转载于:https://stackoverflow.com/questions/2195105/is-there-an-equivalent-to-lisps-runtime-primitive-in-scheme

I too came across this problem today. I am using DrRacket, as it seems to have superseded DrScheme. Though this is an old thread, I am adding my findings for anyone new who stumbles across this thread.

With R5RS as selected language, add following two lines before the program to make it work

(#%require (only racket/base current-milliseconds))
(define (runtime) (current-milliseconds))