package tezos-stdlib-unix

  1. Overview
  2. Docs
val display_progress : ?refresh_rate:(int * int) -> ((('a, Format.formatter, unit, unit) format4 -> 'a) -> unit) -> unit

Print over the current stdout line. Takes a message formatting function of the form (fun m -> m <format_string>). Message formatting occurs only when the line is actually printed (i.e. when (fst refresh_rate) mod (snd refresh_rate) = 0). refresh_rate defaults to always printing the supplied message.

Examples:

  • display_progress (fun m -> m "Loading... %d/100" percent).
  • display_progress ~refresh_rate:(index, 1000) (fun m -> m "Written %d bytes" total). Display progress message when index is divisible by 1000.
val display_progress_end : unit -> unit

Finalizes progress display

OCaml

Innovation. Community. Security.