Created
April 30, 2017 10:09
-
-
Save alinpopa/56343b583e155f85017e033cacfe6e2e to your computer and use it in GitHub Desktop.
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
(* | |
*Compile with: | |
*ocamlfind ocamlc -o test_async -thread -linkpkg -package core,async test_async.ml | |
*Run with: | |
*./test_async | |
*) | |
open Async.Std | |
open Core.Std | |
open Async.Std.Deferred.Infix | |
let () = | |
Clock.run_after (sec 5.0) (fun _ -> print_endline "After 5 seconds") (); | |
Clock.run_after (sec 10.0) (fun _ -> print_endline "After 10 seconds") (); | |
Clock.every (sec 1.0) (fun () -> print_endline " From clock 1!"); | |
Clock.every (sec 2.0) (fun () -> print_endline " From clock 2!"); | |
never_returns (Scheduler.go ()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment