A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://akabe.github.io/ocaml-jupyter/api/jupyter/Jupyter_notebook/Bench/index.html below:

Website Navigation


Bench (jupyter.Jupyter_notebook.Bench)

Types type 'a t = {
  1. b_rtime : 'a;

    Real time for the process

  2. b_utime : 'a;

    User time for the process

  3. b_stime : 'a;

    System time for the process

}

The type of execution time of functions or code snippets.

'a is float or stat.

type stat = {
  1. bs_mean : float;

    Mean of execution time per a loop

  2. bs_std : float;

    Standard deviation of execution time per a loop

}

The type of summary results of repeated measurement of execution time.

Benchmark val time : (unit -> 'a) -> 'a * float t

time f measures execution time of a function f.

val timeit : ?runs:int -> ?loops_per_run:int -> ?before_run:(unit -> unit) -> ?after_run:(unit -> unit) -> (unit -> 'a) -> stat t

timeit ?runs ?loops_per_run ?before_run ?after_run f repeatedly executes a function f, and measures the mean and the standard deviation of each execution time of f ().

for i = 1 to runs do
  before_run () ;
  (* --- start measurement of execution time of each run --- *)
  for _ = 1 to loops_per_run do
    ignore (f ()) ;
  done ;
  (* --- finish measurement --- *)
  after_run () ;
done

timeit is inspired by timeit package in Python. The parameter loops_per_run, before_run are named as number, setup respectively in Python.

Pretty printers val pp : (Stdlib.Format.formatter -> 'a -> unit) -> Stdlib.Format.formatter -> 'a t -> unit val pp_float_t : Stdlib.Format.formatter -> float t -> unit val pp_timedelta : Stdlib.Format.formatter -> float -> unit val pp_stat : Stdlib.Format.formatter -> stat -> unit

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4