如何使用 DrScheme 分析我的函数?
(require profile)
(define (factorial n)
(cond
((= n 1) 1)
(else (* n (factorial (- n 1))))))
(profile factorial)
上面的代码返回
Profiling results
-----------------
Total cpu time observed: 0ms (out of 0ms)
Number of samples taken: 0 (once every 0ms)
====================================
Caller
Idx Total Self Name+srcLocal%
ms(pct) ms(pct) Callee
====================================
>
我试过:-(profile(factorial 100))
-(profile factorial)(factorial 100)
但它给了我相同的结果。我究竟做错了什么?