package incr_dom

  1. Overview
  2. Docs
A library for building dynamic webapps, using Js_of_ocaml

Install

Dune Dependency

Authors

Maintainers

Sources

incr_dom-v0.16.0.tar.gz
sha256=199e5d3ab8299832e3c2c3a08db86a0e5859420e88a867f4da331b91d2078c1b

doc/src/incr_dom.javascript_profiling/javascript_profiling.ml.html

Source file javascript_profiling.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
external js_prof_mark : string -> unit = "js_prof_mark"
external js_prof_measure : string -> string -> string -> unit = "js_prof_measure"
external js_prof_clear_marks : unit -> unit = "js_prof_clear_marks"
external js_prof_clear_measures : unit -> unit = "js_prof_clear_measures"

let mark name = js_prof_mark name
let measure ~name ~start ~end_ = js_prof_measure name start end_

let record name ~f =
  let before_name = name ^ "_before" in
  let after_name = name ^ "_after" in
  let () = mark before_name in
  let res = f () in
  let () = mark after_name in
  measure ~name ~start:before_name ~end_:after_name;
  res
;;

let clear_marks () = js_prof_clear_marks ()
let clear_measures () = js_prof_clear_measures ()

module Manual = struct
  let mark = mark
  let measure = measure
end
OCaml

Innovation. Community. Security.