         delay-nanos>> [ sleep ] when*
     ] if ;
 
-: timer-loop ( timer -- )
+TYPED: timer-loop ( timer: timer -- )
     [ sleep-delay ]
     [ nano-count >>iteration-start-nanos call-timer-loop ]
     [ dup restart?>> [ f >>restart? timer-loop ] [ drop ] if ] tri ;

        maybe-loop-timer
    ] if ;

: sleep-delay ( timer -- )
    dup stop-timer? [
        drop
    ] [

! See http://factorcode.org/license.txt for BSD license.
USING: accessors assocs calendar combinators.short-circuit fry
heaps init kernel math math.functions math.parser namespaces
quotations sequences system threads typed ;
IN: timers

TUPLE: timer
