Which Scheme implementation allows me to check how long a procedure has been running? SICP mentions something about (runtime), but no resource on MIT Scheme says anything.
How long a procedure has been running? Sorry, I am a purely functional programmer -- I do not understand the concept of runtime.
Name:
Anonymous2007-09-09 12:22 ID:nzINk6/g
I don't know. maybe ask for the time before, and for the time after? something like, supossing a function (time) gets you the actual time, and that you can substract both times
(define (time-run fun)
(lambda rest
(let ((init (time)))
(let ((val (apply fun rest)))
(print (- (time) init))
val))))
so time-run gets a function and returns a function that does the same but also it prints the time the function has been running.
what do u think?