Record Class StopWatch.TaskInfo
java.lang.Object
java.lang.Record
cloud.opencode.base.date.StopWatch.TaskInfo
- Record Components:
name- the task name | 任务名称timeNanos- the elapsed time in nanoseconds | 经过时间(纳秒)
- Enclosing class:
StopWatch
Information about a timed task
计时任务的信息
- Since:
- JDK 25, opencode-base-date V1.0.0
- Author:
- Leon Soo www.LeonSoo.com
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionduration()Gets the elapsed time as Duration 获取经过时间作为Durationfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.name()Returns the value of thenamerecord component.longGets the elapsed time in milliseconds 获取经过时间(毫秒)longReturns the value of thetimeNanosrecord component.doubleGets the elapsed time in seconds 获取经过时间(秒)toString()Returns a string representation of this record class.
-
Constructor Details
-
TaskInfo
-
-
Method Details
-
timeMillis
public long timeMillis()Gets the elapsed time in milliseconds 获取经过时间(毫秒)- Returns:
- the time in millis | 毫秒时间
-
timeSeconds
public double timeSeconds()Gets the elapsed time in seconds 获取经过时间(秒)- Returns:
- the time in seconds | 秒时间
-
duration
Gets the elapsed time as Duration 获取经过时间作为Duration- Returns:
- the Duration | Duration
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
name
-
timeNanos
-