Module Imandrakit.Util

Utils

val ptime_now : unit -> float

Use ptime to get a precise timestamp.

val time_since_start : unit -> float

Time since the beginning of the program, using mtime_now

val mtime_now_s : unit -> float
module Stopwatch : sig ... end

Stopwatch, to measure time intervals.

val remove_dups_with : (module CCHashtbl.S with type key = 'a) -> 'a list -> 'a list
val pp_text_newlines : string Imandrakit_common.Fmt.printer
val pp_list : ?sep:string -> 'a Imandrakit_common.Fmt.printer -> 'a list Imandrakit_common.Fmt.printer

print between "`"

val pp_quoted : string Imandrakit_common.Fmt.printer
val str_contains : string -> string -> bool

String containment. s2 must be small

val str_limit_len : int -> string -> string

Limit length of string

val parse_tcp_addr : string -> (Unix.inet_addr * int, string) result
val uuid_v4 : unit -> string

Generate a UUID v4 using a random state

val this_process_uuid : string

Unique UUID for this process. Computed once at startup.

val true_in_env : string -> bool

true_in_env s is true if "s" is set to "1" or "true" in the env

val format_datetime : float -> string

Helper to format time nicely

val pp_datetime : float Imandrakit_common.Fmt.printer
val format_duration_s : float -> string

Human friendly duration printer

val pp_duration_s : float Imandrakit_common.Fmt.printer
val format_byte_size : int -> string

Human friendly size (in Bytes) printer

val pp_byte_size : int Imandrakit_common.Fmt.printer
val reset_line_ansi : string
module List : sig ... end
module Either = CCEither
type ('a, 'b) either = ('a, 'b) CCEither.t =
  1. | Left of 'a
  2. | Right of 'b
val min_opt_int : int option -> int option -> int option