diff options
| author | Alexandre Jesus <adbjesus@gmail.com> | 2025-12-01 14:06:26 +0000 |
|---|---|---|
| committer | Alexandre Jesus <adbjesus@gmail.com> | 2025-12-01 14:06:26 +0000 |
| commit | 7a3141b79caf7023ae02ec04dae85a8946d370a9 (patch) | |
| tree | 2d741a13160e387b17a14ae6c989b0189f5489cb | |
| parent | 04381ba237f9bc3c0a28d7c8fa5f6f748a9997e9 (diff) | |
| download | aoc2025-7a3141b79caf7023ae02ec04dae85a8946d370a9.tar.gz aoc2025-7a3141b79caf7023ae02ec04dae85a8946d370a9.zip | |
Add time measurement and ocamlformat
| -rw-r--r-- | bin/dune | 2 | ||||
| -rw-r--r-- | bin/main.ml | 4 | ||||
| -rw-r--r-- | flake.nix | 1 |
3 files changed, 5 insertions, 2 deletions
@@ -5,4 +5,4 @@ (executable (public_name aoc2025) (name main) - (libraries aoc2025)) + (libraries aoc2025 unix)) diff --git a/bin/main.ml b/bin/main.ml index 2cddf84..0ffbaac 100644 --- a/bin/main.ml +++ b/bin/main.ml @@ -37,7 +37,9 @@ let () = let fn = day_part_fn args.(2) args.(1) in let ic = open_in args.(0) in try - fn ic + let s = Unix.gettimeofday () in + fn ic; + Printf.printf "%.3f" ((Unix.gettimeofday ()) -. s) with e -> close_in_noerr ic; raise e @@ -23,6 +23,7 @@ ] ++ (with ocamlPackages; [ ocaml ocaml-lsp + ocamlformat ]); }; }; |
