类 TimeUtil

java.lang.Object
com.alibaba.csp.sentinel.util.TimeUtil
所有已实现的接口:
Runnable

public final class TimeUtil extends Object implements Runnable

Provides millisecond-level time of OS.

Here we should see that not all the time TimeUtil should keep looping 1_000 times every second (Actually about 800/s due to some losses).

 * In idle conditions it just acts as System.currentTimeMillis();
 * In busy conditions (significantly more than 1_000/s) it keeps loop to reduce costs.
 
For detail design and proposals please goto https://github.com/alibaba/Sentinel/issues/1702
作者:
qinan.qn, jason
  • 构造器详细资料

    • TimeUtil

      public TimeUtil()
  • 方法详细资料

    • run

      public void run()
      指定者:
      run 在接口中 Runnable
    • getState

      public TimeUtil.STATE getState()
      Current running state
      返回:
    • currentQps

      public Tuple2<Long,Long> currentQps(long now)
      Current qps statistics (including reads and writes request) excluding current working time window for accurate result.
      参数:
      now -
      返回:
    • getTime

      public long getTime()
      Current timestamp in milliseconds.
      返回:
    • instance

      public static TimeUtil instance()
    • currentTimeMillis

      public static long currentTimeMillis()