19 Profiling tools
(require (planet untyped/unlib/profile)) |
Simple profiling tools.
| |||||
name : symbol? |
Structure used to record a running total time. Only one timer can be running at a time per thread. The accumulated time associated with a timer can be retrieved using timer-value and printed by printing the timer.
(profile timer fn arg ) → any |
timer : timer? |
fn : procedure? |
arg : any |
Applies fn to args and returns the result. Measures the time taken to apply fn and adds it to the running total in timer. Timers are only updated when control passes into or out of a profile form.
(with-timer timer expr ) |
Syntactic shorthand for:
(profile timer (lambda () expr ))
(timer-value timer) → number? |
timer : timer? |
Returns the current value of timer. Timers are only updated when control passes into or out of a profile form.
(current-timer) → timer? |
Returns the timer that is currently running.
(all-timers) → (listof timer?) |
Returns a list of all timers created with make-timer or define-timer, plus a single predefined timer called 'top.
(define-timer id) |
Syntactic shorthand for:
(define id (make-timer 'id))