Permalink
Browse files

added alarm (app03.c example)

  • Loading branch information...
1 parent 2df960f commit 09dbb6a6c44ce606bb45bc1707225a5283155222 @tvcutsem committed Sep 10, 2012
Showing with 14 additions and 0 deletions.
  1. +14 −0 doc/alarm.scm
View
14 doc/alarm.scm
@@ -0,0 +1,14 @@
+; translation of example app03.c from Ken distribution
+; illustrates Ken alarms
+
+; note: ken-next-alarm not yet implemented!
+
+(begin
+ (define count 0)
+ (set! ken-receive-handler
+ (lambda (id msg)
+ (if (eq? id (ken-alarm-id))
+ (display "I've gotten " count " messages")
+ (display "news just arrived: message " (set! count (+ 1 count))))
+ (set! ken-next-alarm (* 1000 1000))))
+ (display "the world is exciting and new!"))

0 comments on commit 09dbb6a

Please sign in to comment.