Handbook
Glossary
(add-timing) ( def word -- def' )
Vocabulary
tools
.
annotations
.
private
Inputs
def
an
object
word
an
object
Outputs
def'
an
object
Definition
USING:
assocs
continuations
kernel
math
namespaces
sequences
system
threads
tools.annotations
words
;
IN:
tools.annotations.private
::
(add-timing)
( def word -- def' )
gensym
:>
active
[
word
word-timing
get
[
drop
{
0 0
}
clone
]
cache
:>
entry 1 entry
[
1
+
]
change-nth
active
get
self
eq?
[
def
call
]
[
self
active
[
nano-count
:>
start def
[
nano-count
start
-
0 entry
[
+
]
change-nth
]
finally
]
with-variable
]
if
]
;