package why3find

  1. Overview
  2. Docs
A Why3 Package Manager

Install

dune-project
 Dependency

Authors

Maintainers

Sources

why3find-1.3.0.tar.gz
md5=435da830a513fd91ec5411c91126b763
sha512=fd8b04eb16d569c0dc9e5595a40b174d7858121b080c81d459b2f28fb3af1ebc32ef408859d5c1c5f45c61790625c027c2ecfc3d45e597943543de7212bab8d6

doc/why3find.utils/Why3findUtils/Timer/index.html

Module Why3findUtils.TimerSource

Time related features.

Timers

A timer is created with create, and can the be started with start. A running timer can be stopped with stop and the time of this run (the time elapsed since last start) is added to the timer. A new run can then be started with start

Sourcetype timer

The type of timers.

Sourceval create : unit -> timer

Return a new timer.

Sourceval start : timer -> unit

Start the timer.

Sourceval stop : timer -> unit

Stop the timer.

Sourceval count : timer -> int

Return the number of runs.

Sourceval min_time : timer -> float

Return the time of the shortest run.

Sourceval max_time : timer -> float

Return the time of the longest run.

Sourceval average_time : timer -> float

Return the average time of a run.

Sourceval total_time : timer -> float

Return the total time (the sum of the time of every run).

Sourceval create_global : string -> timer

Create and register a timer to be printed by print_timings. The string argument is the timer name.

Sourceval timed : name:string -> ('a -> 'b) -> 'a -> 'b

Return a timed version of the argument function : a global timer of name name will time the function execution.

Sourceval timed2 : name:string -> ('a -> 'b -> 'c) -> 'a -> 'b -> 'c

Same as timed for binary functions.

Sourceval timed3 : name:string -> ('a -> 'b -> 'c -> 'd) -> 'a -> 'b -> 'c -> 'd

Same as timed for ternary functions.

Sourceval print_timings : Format.formatter -> unit

Print the global timers on the given formatter.

Throttles

Sourceval throttle : ?delay:float -> ('a -> unit) -> ?force:bool -> 'a -> unit

throttle ~delay:d f make succesive calls to f to only happen every ~delay seconds. The delayed function can be passed ~force:true to apply f immediately. Defaults to ~delay:0.1 which is 100ms.