类 TimerContext
java.lang.Object
com.alibaba.nacos.core.utils.TimerContext
Simple task time calculation,Currently only the task time statistics task that supports synchronizing code blocks is
supported.
- 作者:
- liaochuntao
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明static voidstatic voidEnd the task and print based on the log level.static voidExecution with time-consuming calculations forRunnable.static <T> voidExecution with time-consuming calculations forConsumer.static <T, R> RExecution with time-consuming calculations forFunction.static <V> VExecution with time-consuming calculations forSupplier.static voidRecord context start time.
-
构造器详细资料
-
TimerContext
public TimerContext()
-
-
方法详细资料
-
start
Record context start time.- 参数:
name- context name
-
end
-
end
End the task and print based on the log level.- 参数:
name- context namelogger- loggerlevel- logger level
-
run
Execution with time-consuming calculations forRunnable.- 参数:
job- runnablename- job namelogger- logger
-
run
Execution with time-consuming calculations forSupplier.- 参数:
job- Suppliername- job namelogger- logger
-
run
Execution with time-consuming calculations forFunction.- 参数:
job- Functionargs- argsname- job namelogger- logger
-
run
Execution with time-consuming calculations forConsumer.- 参数:
job- Consumerargs- argsname- job namelogger- logger
-