From da29171d0139bc1be36772084d58b6cbcfdca646 Mon Sep 17 00:00:00 2001 From: Claudio Sacerdoti Coen Date: Fri, 23 Sep 2005 16:47:52 +0000 Subject: [PATCH] More profiling code. --- helm/ocaml/xml/xml.ml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/helm/ocaml/xml/xml.ml b/helm/ocaml/xml/xml.ml index 4439fad1d..42ce7ba57 100644 --- a/helm/ocaml/xml/xml.ml +++ b/helm/ocaml/xml/xml.ml @@ -101,12 +101,9 @@ let pp_to_outchan strm oc = flush oc ;; -let pp_to_outchan = - let profiler = HExtlib.profile "Xml.pp_to_outchan" in - fun strm oc -> profiler.HExtlib.profile (pp_to_outchan strm) oc - let pp_to_gzipchan strm oc = pp_gen (fun s -> Gzip.output oc s 0 (String.length s)) strm +;; (** pretty printer to string *) let pp_to_string strm = @@ -144,6 +141,12 @@ let pp ?(gzip=false) strm fn = | None -> pp_to_outchan strm stdout ;; +let pp = + let profiler = HExtlib.profile "Xml.pp" in + fun ?gzip strm fn -> + profiler.HExtlib.profile (pp ?gzip strm) fn +;; + let add_xml_declaration stream = let box_prefix = "b" in [< -- 2.39.2