From: Siraaj Khandkar Date: Wed, 14 Nov 2018 16:06:40 +0000 (-0500) Subject: Report total number of files and execution time X-Git-Url: https://git.xandkar.net/?p=dups.git;a=commitdiff_plain;h=f16e6ff141c216f7d696a899994047e1b92b20f2 Report total number of files and execution time --- diff --git a/dupfiles.ml b/dupfiles.ml index 1bd4d64..8a555e8 100644 --- a/dupfiles.ml +++ b/dupfiles.ml @@ -78,7 +78,10 @@ let main input = | Root_path root -> Stream.rec_file_paths ~root in let paths_by_digest = Hashtbl.create 1_000_000 in + let path_count = ref 0 in + let t0 = Sys.time () in Stream.iter paths ~f:(fun path -> + incr path_count; try let digest = Digest.file path in let paths = @@ -100,7 +103,9 @@ let main input = List.iter paths ~f:(fun path -> printf " %s\n%!" path) end ) - paths_by_digest + paths_by_digest; + let t1 = Sys.time () in + eprintf "Processed %d files in %f seconds.\n%!" !path_count (t1 -. t0) let () = let input = ref Paths_on_stdin in