package lsp
LSP protocol implementation in OCaml
Install
Dune Dependency
Authors
-
AAndrey Popp <8mayday@gmail.com>
-
RRusty Key <iam@stfoo.ru>
-
LLouis Roché <louis@louisroche.net>
-
OOleksiy Golovko <alexei.golovko@gmail.com>
-
RRudi Grinberg <me@rgrinberg.com>
-
SSacha Ayoun <sachaayoun@gmail.com>
-
Ccannorin <cannorin@gmail.com>
-
UUlugbek Abdullaev <ulugbekna@gmail.com>
-
Thibaut Mattio
-
MMax Lantas <mnxndev@outlook.com>
Maintainers
Sources
jsonrpc-1.10.3.tbz
sha256=a3ac1073b0728b94f4bdb0111772c0abaf7ff70324399450eab7156bfac151f1
sha512=bed6ddbde28088e43db0d40ab27056ba22537d19ffe8117a3da4c77676948f18708b06937dd2c972dce5c5822ea751c9c85cfa1ce3c1b3739460d4a24ebc2282
doc/src/lsp.stdune/metrics.ml.html
Source file metrics.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 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
# 1 "submodules/dune/otherlibs/stdune/metrics.ml" let enabled = ref false let enable () = enabled := true module Timer = struct module Measure = struct type t = { cumulative_time : float ; count : int } end type t = { start_time : float ; tag : string ; mutable stopped : bool } let aggregate = ref String.Map.empty let aggregated_timers () = !aggregate let update_aggregate { start_time; tag; stopped } = if not stopped then aggregate := String.Map.update !aggregate tag ~f:(function | Some { Measure.cumulative_time; count } -> Some { Measure.cumulative_time = cumulative_time +. (Unix.gettimeofday () -. start_time) ; count = count + 1 } | None -> Some { Measure.cumulative_time = Unix.gettimeofday () -. start_time ; count = 1 }) let start tag = { start_time = Unix.gettimeofday (); tag; stopped = false } let stop t = match !enabled with | false -> Code_error.raise "Tried to stop a previously stopped timer" [ ("tag", String t.tag) ] | true -> update_aggregate t; t.stopped <- true let record tag ~f = match !enabled with | false -> f () | true -> let start_time = Unix.gettimeofday () in Exn.protect ~f ~finally:(fun () -> update_aggregate { tag; start_time; stopped = false }) end let reset () = Timer.aggregate := String.Map.empty
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>