package incr_dom
A library for building dynamic webapps, using Js_of_ocaml
Install
Dune Dependency
Authors
Maintainers
Sources
v0.17.0.tar.gz
sha256=a3a9ef135edd2039b5e771dfd9461ff2bbae55e2611af0e81c9577898314a76f
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 26 27 28 29 30 31 32 33 34 35 36
open Js_of_ocaml class type performance = object method mark : Js.js_string Js.t -> unit Js.meth method measure : Js.js_string Js.t -> Js.js_string Js.t -> Js.js_string Js.t -> unit Js.meth method clearMarks : unit Js.meth method clearMeasures : unit Js.meth end let perf () : performance Js.t = Js.Unsafe.global##.performance let mark name = (perf ())##mark (Js.string name) let measure ~name ~start ~end_ = (perf ())##measure (Js.string name) (Js.string start) (Js.string 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 () = (perf ())##clearMarks let clear_measures () = (perf ())##clearMeasures module Manual = struct let mark = mark let measure = measure end
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>