Handbook
Glossary
profile-vocab ( vocab quot -- )
Vocabulary
wordtimer
Inputs
vocab
a
string
quot
a quotation to run
Outputs
None
Word description
Annotates the words in the vocab with timing code then runs the quotation. Finally resets the words and prints the timings information.
Definition
USING:
io
kernel
prettyprint
tools.time
;
IN:
wordtimer
:
profile-vocab
( vocab quot -- )
"annotating vocab..."
print
flush
over
[
reset-vocab
]
[
add-timers
]
bi
reset-word-timer
"executing quotation..."
print
flush
benchmark
[
"resetting annotations..."
print
flush
reset-vocab
correct-for-timing-overhead
"total time:"
write
]
dip
pprint
print-word-timings
;
inline