src/HOL/Mirabelle/Tools/mirabelle.ML
changeset 42012 2c3fe3cbebae
parent 41481 820034384c18
child 42014 75417ef605ba
equal deleted inserted replaced
42011:dee23d63d466 42012:2c3fe3cbebae
   207   (case Option.map Int.fromString (AList.lookup (op =) settings key) of
   207   (case Option.map Int.fromString (AList.lookup (op =) settings key) of
   208     SOME (SOME i) => i
   208     SOME (SOME i) => i
   209   | SOME NONE => error ("bad option: " ^ key)
   209   | SOME NONE => error ("bad option: " ^ key)
   210   | NONE => default)
   210   | NONE => default)
   211 
   211 
   212 fun cpu_time f x =
   212 fun cpu_time f x =  (* FIXME !? *)
   213   let
   213   let
   214     val start = start_timing ()
   214     val start = Timing.start ()
   215     val result = Exn.capture (fn () => f x) ()
   215     val result = Exn.capture (fn () => f x) ()
   216     val time = Time.toMilliseconds (#cpu (end_timing start))
   216     val time = Time.toMilliseconds (#cpu (Timing.result start))
   217   in (Exn.release result, time) end
   217   in (Exn.release result, time) end
   218 
   218 
   219 end
   219 end