package eio-trace
Trace visualisation for Eio programs
Install
Dune Dependency
Authors
Maintainers
Sources
eio-trace-0.4.tbz
sha256=e5f590734c92d52f607a7af4ad9d54be9af79f3c38040ca92eff47c0d24e3eaf
sha512=e50e7a2bae8472e80d881f837e32d4da5d0d2872e1fb8b80052d65012e75a4db0a9ca2576246e80d8e450965a13a72396c8da6346b6ea4bfaedf78c7293d53bc
doc/src/eio-trace/time.ml.html
Source file time.ml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
let of_string s = match Scanf.sscanf_opt s "%f %s" @@ fun v units -> match units with | "" | "s" -> Ok v | "m" -> Ok (v *. 60.) | "ms" -> Ok (v /. 1e3) | "us" -> Ok (v /. 1e6) | "ns" -> Ok (v /. 1e9) | x -> Fmt.error "Unknown time unit %S" x with | None -> Fmt.error "Invalid duration %S" s | Some x -> x let pp f x = if x >= 1.0 then Fmt.pf f "%gs" x else if x >= 1e-3 then Fmt.pf f "%gms" (x *. 1e3) else if x >= 1e-6 then Fmt.pf f "%gus" (x *. 1e6) else Fmt.pf f "%gns" (x *. 1e9) let to_string = Fmt.to_to_string pp
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>