类 StopWatch

java.lang.Object
cn.taketoday.util.StopWatch

public class StopWatch extends Object
Simple stop watch, allowing for timing of a number of tasks, exposing total running time and running time for each named task.

Conceals use of System.nanoTime(), improving the readability of application code and reducing the likelihood of calculation errors.

Note that this object is not designed to be thread-safe and does not use synchronization.

This class is normally used to verify performance during proof-of-concept work and in development, rather than as part of production applications.

从以下版本开始:
3.0
作者:
Rod Johnson, Juergen Hoeller, Sam Brannen, TODAY 2021/2/4 11:26
  • 构造器详细资料

    • StopWatch

      public StopWatch()
      Construct a new StopWatch.

      Does not start any task.

    • StopWatch

      public StopWatch(String id)
      Construct a new StopWatch with the given ID.

      The ID is handy when we have output from multiple stop watches and need to distinguish between them.

      Does not start any task.

      参数:
      id - identifier for this stop watch
  • 方法详细资料