• Effekt Logo Effekt Library
    • bench
      • Nanos
      • timestamp
      • relativeTimestamp
      • Duration
      • diff
      • timed
      • measure
      • formatMs
    • bench
    • Jump to source: libraries/common/bench.effekt
      Example usage: examples/stdlib/bench
      • Nanos
      • timestamp : Nanos / {}
      • The current time (since UNIX Epoch) in nanoseconds.
        
        The actual precision varies across the different backends.
        - js: Milliseconds
        - chez: Microseconds
      • relativeTimestamp : Nanos / {}
      • 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).
      • Duration
      • diff (fromNanos: Nanos, toNanos: Nanos): Duration / {}
      • timed { block: => Unit }: Duration / {}
      • Runs the block and returns the time in nanoseconds
      • measure (warmup: Int, iterations: Int) { block: => Unit }: Unit / {}
      • formatMs (nanos: Nanos): String / {}
      • Takes a duration in nanoseconds and formats it in milliseconds with precision of two decimal digits.