Skip to content

Instantly share code, notes, and snippets.

@kuy
Created April 2, 2017 15:12
Show Gist options
  • Select an option

  • Save kuy/368625c7323454517321cb8d4a3b402d to your computer and use it in GitHub Desktop.

Select an option

Save kuy/368625c7323454517321cb8d4a3b402d to your computer and use it in GitHub Desktop.
Periodic timer using OCaml + Core + Async.
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