Last active
August 29, 2015 14:26
-
-
Save msullivan/3bb033d4367ac6af01bc 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
| let time_execution func = | |
| let start_time = Sys.time () in | |
| let ret = func () in | |
| let end_time = Sys.time () in | |
| end_time -. start_time, ret | |
| (* val time_execution : (unit -> 'a) -> float * 'a *) | |
| let print_stuff () = Printf.printf "hello, world\n" | |
| let compute_stuff () = 10 + 10 | |
| let print_time, () = time_execution print_stuff | |
| let compute_time, value = time_execution compute_stuff |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment