Interface Timer

All Superinterfaces:
Metric

public interface Timer extends Metric
Timers record elapsed time.
  • Nested Class Summary

    Nested classes/interfaces inherited from interface com.mendix.metrics.Metric

    Metric.Builder<M extends Metric>
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    record(long amount, TimeUnit unit)
    Records elapsed time.
    <T> T
    record(Supplier<T> func)
    Executes given function and records execution time.
  • Method Details

    • record

      void record(long amount, TimeUnit unit)
      Records elapsed time.
      Parameters:
      amount - elapsed time
      unit - elapsed time unit
    • record

      <T> T record(Supplier<T> func)
      Executes given function and records execution time.
      Type Parameters:
      T - parameter type of the function
      Parameters:
      func - function to execute
      Returns:
      returning value from the function