Browse Source

Add timer to see how long it was

Leo 10 years ago
parent
commit
1723cb8a5b
2 changed files with 25 additions and 22 deletions
  1. 17 22
      setup.data
  2. 8 0
      src/oclaunch.ml

+ 17 - 22
setup.data

@@ -1,17 +1,17 @@
-ocamlfind="/home/lwzukw/.opam/4.01.0/bin/ocamlfind"
-ocamlc="/home/lwzukw/.opam/4.01.0/bin/ocamlc.opt"
-ocamlopt="/home/lwzukw/.opam/4.01.0/bin/ocamlopt.opt"
-ocamlbuild="/home/lwzukw/.opam/4.01.0/bin/ocamlbuild"
+ocamlfind="/home/lwzukw/.opam/4.02.1/bin/ocamlfind"
+ocamlc="/home/lwzukw/.opam/4.02.1/bin/ocamlc.opt"
+ocamlopt="/home/lwzukw/.opam/4.02.1/bin/ocamlopt.opt"
+ocamlbuild="/home/lwzukw/.opam/4.02.1/bin/ocamlbuild"
 pkg_name="OcLaunch"
-pkg_version="0.1.2"
+pkg_version="0.2.2.1-dev"
 os_type="Unix"
 system="linux_elf"
 architecture="i386"
 ccomp_type="cc"
-ocaml_version="4.01.0"
-standard_library_default="/home/lwzukw/.opam/4.01.0/lib/ocaml"
-standard_library="/home/lwzukw/.opam/4.01.0/lib/ocaml"
-standard_runtime="/home/lwzukw/.opam/4.01.0/bin/ocamlrun"
+ocaml_version="4.02.1"
+standard_library_default="/home/lwzukw/.opam/4.02.1/lib/ocaml"
+standard_library="/home/lwzukw/.opam/4.02.1/lib/ocaml"
+standard_runtime="/home/lwzukw/.opam/4.02.1/bin/ocamlrun"
 bytecomp_c_compiler="gcc -fno-defer-pop -Wall -D_FILE_OFFSET_BITS=64 -D_REENTRANT -fPIC"
 native_c_compiler="gcc -Wall -D_FILE_OFFSET_BITS=64 -D_REENTRANT"
 model="default"
@@ -45,19 +45,14 @@ is_native="true"
 suffix_program=""
 rm="rm -f"
 rmdir="rm -rf"
-debug="false"
+debug="true"
 profile="false"
 native_dynlink="true"
 ocamlbuildflags=""
-docs="false"
-tests="true"
-camlp4o="/home/lwzukw/.opam/4.01.0/bin/camlp4o"
-pkg_core="/home/lwzukw/.opam/4.01.0/lib/core"
-pkg_core_extended="/home/lwzukw/.opam/4.01.0/lib/core_extended"
-pkg_atdgen="/home/lwzukw/.opam/4.01.0/lib/atdgen"
-pkg_threads="/home/lwzukw/.opam/4.01.0/lib/ocaml"
-pkg_alcotest="/home/lwzukw/.opam/4.01.0/lib/alcotest"
-pkg_ounit="/home/lwzukw/.opam/4.01.0/lib/oUnit"
-pkg_biniou="/home/lwzukw/.opam/4.01.0/lib/biniou"
-pkg_config_file="/home/lwzukw/.opam/4.01.0/lib/config-file"
-pkg_yojson="/home/lwzukw/.opam/4.01.0/lib/yojson"
+docs="true"
+tests="false"
+camlp4o="/home/lwzukw/.opam/4.02.1/bin/camlp4o"
+pkg_core="/home/lwzukw/.opam/4.02.1/lib/core"
+pkg_core_extended="/home/lwzukw/.opam/4.02.1/lib/core_extended"
+pkg_atdgen="/home/lwzukw/.opam/4.02.1/lib/atdgen"
+pkg_threads="/home/lwzukw/.opam/4.02.1/lib/ocaml"

+ 8 - 0
src/oclaunch.ml

@@ -46,8 +46,16 @@ let version_number = "0.2.2.1-dev";;
 let build_info = ( "Build with OCaml version " ^ (Sys.ocaml_version) ^ " on " ^ (Sys.os_type) );;
 
 let () =
+  (* Store begin time *)
+  let start = Time.(now () |> to_float) in
+
+  (* Running commands *)
   Command.run ~version:version_number ~build_info:build_info
   Command_def.commands;
+
+  (* Display total running time, to float is a number of secconds *)
+  Messages.debug Time.(now () |> to_float |> (-.) start |> ( *. ) (-1.)
+  |> sprintf "Runned during %f second(s)");
   (* Reset display *)
   Messages.reset ()
 ;;