Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
12
Task/Rate-counter/Racket/rate-counter.rkt
Normal file
12
Task/Rate-counter/Racket/rate-counter.rkt
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
#lang racket
|
||||
|
||||
;; Racket has a useful `time*' macro that does just what's requested:
|
||||
;; run some expression N times, and produce timing results
|
||||
(require unstable/time)
|
||||
|
||||
;; Sample use:
|
||||
(define (fib n) (if (<= n 1) n (+ (fib (- n 1)) (fib (- n 2)))))
|
||||
(time* 10 (fib 38))
|
||||
|
||||
;; But of course, can be used to measure external processes too:
|
||||
(time* 10 (system "sleep 1"))
|
||||
Loading…
Add table
Add a link
Reference in a new issue