comparison timer.ur @ 0:37eefd0a2ed4
Import code from elsewhere
author |
Adam Chlipala <adam@chlipala.net> |
date |
Tue, 14 Dec 2010 10:55:22 -0500 |
parents |
|
children |
|
comparison
equal
deleted
inserted
replaced
|
1 type t = source bool |
|
2 |
|
3 fun create r = |
|
4 b <- source False; |
|
5 spawn (sleep r.Milliseconds; |
|
6 b <- get b; |
|
7 if b then |
|
8 return () |
|
9 else |
|
10 r.Action); |
|
11 return b |
|
12 |
|
13 fun cancel b = set b True |