-
Effekt Library
- bench
- Nanos
- timestamp
- relativeTimestamp
- Duration
- diff
- timed
- measure
- formatMs
- bench Jump to source: libraries/common/bench.effekt
- Nanos
- timestamp
: Nanos / {}
- relativeTimestamp
: Nanos / {}
- Duration
- diff
(fromNanos: Nanos, toNanos: Nanos): Duration / {}
- timed
{ block: => Unit }: Duration / {}
- measure
(warmup: Int, iterations: Int) { block: => Unit }: Unit / {}
- formatMs
(nanos: Nanos): String / {}
Example usage: examples/stdlib/bench
The current time (since UNIX Epoch) in nanoseconds. The actual precision varies across the different backends. - js: Milliseconds - chez: Microseconds
High-precision timestamp in nanoseconds that should be for measurements. This timestamp should only be used for **relative** measurements, as gives no guarantees on the absolute time (unlike a UNIX timestamp).
Runs the block and returns the time in nanoseconds
Takes a duration in nanoseconds and formats it in milliseconds with precision of two decimal digits.