Created
April 2, 2017 15:12
-
-
Save kuy/368625c7323454517321cb8d4a3b402d to your computer and use it in GitHub Desktop.
Periodic timer using OCaml + Core + Async.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| open Core.Std | |
| open Async.Std | |
| let rec timer () = | |
| after (sec 5.) | |
| >>= fun _ -> | |
| print_endline "Hello"; | |
| timer () | |
| let _ = | |
| Command.async ~summary:"Periodic timer" | |
| Command.Spec.empty timer | |
| |> Command.run |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment