(add-timing) ( def word -- def' )


Vocabulary
tools.annotations.private

Definition
USING: arrays assocs kernel math namespaces sequences
tools.annotations tools.time ;

IN: tools.annotations.private

: (add-timing) ( def word -- def' )
[ [ benchmark ] curry ] dip [
word-timing get [
[
[ 0 swap [ + ] change-nth ] keep
[ 1 swap [ 1 + ] change-nth ] keep
] [ 1 2array ] if*
] change-at
] curry compose ;