[project @ 1996-01-08 20:28:12 by partain]
[ghc-hetmet.git] / ghc / misc / examples / posix / po008 / Main.hs
diff --git a/ghc/misc/examples/posix/po008/Main.hs b/ghc/misc/examples/posix/po008/Main.hs
new file mode 100644 (file)
index 0000000..c775064
--- /dev/null
@@ -0,0 +1,12 @@
+import LibPosix
+
+main =
+    installHandler realTimeAlarm (Catch alarmclock) Nothing >>
+    putStr "Scheduling an alarm in 5 seconds...\n" >>
+    scheduleAlarm 5 >>
+    putStr "Sleeping one minute.\n" >>
+    sleep 60 >>
+    putStr "How did I get here?\n"
+
+alarmclock =
+    putStr "The alarm went off.\n"