comparison examples/countdown.ur @ 17:2947170fcfd6

Fix sign error in clock skew correction
author Adam Chlipala <adam@chlipala.net>
date Sun, 21 Aug 2011 11:27:41 -0400
parents
children
comparison
equal deleted inserted replaced
16:2e397d373289 17:2947170fcfd6
1 fun main () : transaction page =
2 start <- now;
3 deadline <- return (addSeconds start 60);
4 cl <- Clock.create 500;
5 return <xml><body onload={Clock.start cl}>
6 <dyn signal={cl <- Clock.signal cl;
7 return <xml>
8 {[cl]}<br/>
9 {if cl > deadline then
10 <xml><b>Expired</b></xml>
11 else
12 <xml>{[diffInSeconds cl deadline]}</xml>}
13 </xml>}/>
14 </body></xml>