         swap >>quot ; inline
 
 : start-alarm ( alarm -- )
-    f >>stop?
-    nano-count >>start-nanos
-    call-alarm ;
+    [
+        '[
+            _ nano-count >>start-nanos
+            [ delay-nanos>> [ sleep ] when* ]
+            [ nano-count >>iteration-start-nanos call-alarm-loop ] bi
+        ] "Alarm execution" spawn
+    ] keep thread<< ;
 
 : stop-alarm ( alarm -- )
-    t >>stop?
-    f >>start-nanos
-    drop ;
+    dup quotation-running?>> [
+        f >>thread drop
+    ] [
+        [ [ interrupt ] when* f ] change-thread drop
+    ] if ;
 
 <PRIVATE
 

    delay-nanos
    interval-nanos
    iteration-start-nanos
    { stop? boolean }
    thread ;

<PRIVATE

    over interval-nanos>> *
    over start-nanos>> +
    over delay-nanos>> [ + ] when*
    >>iteration-start-nanos ;

: stop-alarm? ( alarm -- ? )
    thread>> self eq? not ;

DEFER: call-alarm-loop

