view timer.ur @ 30:c1f06342c81f

Add margin example
author Adam Chlipala <adam@chlipala.net>
date Sat, 12 May 2012 10:07:45 -0400
parents 37eefd0a2ed4
children
line wrap: on
line source
type t = source bool

fun create r =
    b <- source False;
    spawn (sleep r.Milliseconds;
           b <- get b;
           if b then
               return ()
           else
               r.Action);
    return b

fun cancel b = set b True