view timer.ur @ 27:5905b56e0cd9

Adapt to new HTML contexts
author Adam Chlipala <adam@chlipala.net>
date Tue, 20 Dec 2011 21:04:21 -0500
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