view timer.ur @ 11:ccd0a169e827

Clock corrects for skew, so that it matches server time (if an RPC round-trips fast enough)
author Adam Chlipala <adam@chlipala.net>
date Sun, 24 Jul 2011 14:51:16 -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