Class Stopwatch

java.lang.Object
org.openstreetmap.josm.tools.Stopwatch

public final class Stopwatch extends Object
Measures elapsed time in milliseconds
Since:
15755
See Also:
  • Field Details

    • start

      private final long start
  • Constructor Details

  • Method Details

    • createStarted

      public static Stopwatch createStarted()
      Creates and starts a stopwatch
      Returns:
      the started stopwatch
    • elapsed

      public long elapsed()
      Returns the elapsed milliseconds
      Returns:
      the elapsed milliseconds
    • toString

      public String toString()
      Formats the duration since start as string
      Overrides:
      toString in class Object
      Returns:
      the duration since start as string
      See Also:
    • toString

      public String toString(String taskName)
      Formats the given task name and duration since start as i18n string
      Parameters:
      taskName - the task name
      Returns:
      the task name and duration since start as i18n string