package incr_dom
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/incr_dom.ui_incr/Ui_incr/Map/Instrumentation/index.html
Module Map.Instrumentation
Source
All Incr_map
functions take an optional instrumentation
parameter that has type Instrumentation.t
. A value of this type is a record containing a function which is polymorphic over a universally-quantified type 'a
. This function is passed a unit -> 'a
function, which must be immediately executed, and the result of which must be returned.
The function passed to the instrumentor will be doing the bulk of the work for the Incr_map
function in question (usually a Map.fold_symmetric_diff
).
You may want to use the Instrumentation API to assist in performance profiling like so:
let profile name =
{ Incr_map.Instrumentation.f = fun f ->
let before = Time.now () in
let r = f () in
let after = Time.now () in
let delta = Time.sub after before in
printf "%s took %s" name (Time.Span.to_string_hum delta);
r
}
;;
Incr_map.map ~instrumentation:(profile "foo") ~f:map_foo
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>