Initializes a new instance of the Time class using the given time value parameter.
A value representing the length of time, accepted as a string that parses to a number (e.g. "1000" or "1e-10"), a big decimal or a number.
Whether the given is an approximation or not. The result of any arithmetic operations involving this time will also be approximated.
Initializes a new instance of the Time class using the given time value parameter.
A value representing the length of time, accepted as a string that parses to a number (e.g. "1000" or "1e-10"), a big decimal or a number.
Gets the big decimal representation of the time length, in nanoseconds.
Gets whether the value of this is an approximation. This is determined at construction and it remains in all operations with that this time is involved.
Gets the numeric representation of the time length in nanoseconds.
Gets the numeric representation of the time length, in nanoseconds.
Adds the value of this time with the value of another time. If either are approximations, the result will also be.
A value representing the length of time, accepted as a string that parses to a number (e.g. "1000" or "1e-10"), a big decimal or a number -or- another Time instance used to be added to this time.
Time unit used as source for the conversion of value
. This defaults to "nanosecond" and is ignored when a
Time object is provided.
A Time object with the values of both times added to each other.
Adds the value of this time with the value of another time. If either are approximations, the result will also be.
A value representing the length of time, accepted as a string that parses to a number (e.g. "1000" or "1e-10"), a big decimal or a number -or- another Time instance used to be added to this time.
Time unit used as source for the conversion of value
. This defaults to "nanosecond" and is ignored when a
Time object is provided. Accepts plurals and case variations.
A Time object with the values of both times added to each other.
Creates and returns a new time object that contains the value of this time, however with the approximated flag.
Approximated time in relation to this time.
Divides the value of this time by the value of another time. If either are approximations, the result will also be.
A value representing the length of time, accepted as a string that parses to a number (e.g. "1000" or "1e-10"), a big decimal or a number -or- another Time instance used to divide this time.
Time unit used as source for the conversion of value
. This defaults to "nanosecond" and is ignored when a
Time object is provided.
A Time object with the value of this time divided by the value of the other time.
Divides the value of this time by the value of another time. If either are approximations, the result will also be.
A value representing the length of time, accepted as a string that parses to a number (e.g. "1000" or "1e-10"), a big decimal or a number -or- another Time instance used to divide this time.
Time unit used as source for the conversion of value
. This defaults to "nanosecond" and is ignored when a
Time object is provided. Accepts plurals and case variations.
A Time object with the value of this time divided by the value of the other time.
Multiplies the value of this time with the value of another time. If either are approximations, the result will also be.
A value representing the length of time, accepted as a string that parses to a number (e.g. "1000" or "1e-10"), a big decimal or a number -or- another Time instance used to be multiplied by this time.
Time unit used as source for the conversion of value
. This defaults to "nanosecond" and is ignored when a
Time object is provided.
A Time object with the value of both times multiplied by each other.
Multiplies the value of this time with the value of another time. If either are approximations, the result will also be.
A value representing the length of time, accepted as a string that parses to a number (e.g. "1000" or "1e-10"), a big decimal or a number -or- another Time instance used to be multiplied by this time.
Time unit used as source for the conversion of value
. This defaults to "nanosecond" and is ignored when a
Time object is provided. Accepts plurals and case variations.
A Time object with the value of both times multiplied by each other.
Subtracts the value of another time from the value of this time. If either are approximations, the result will also be.
A value representing the length of time, accepted as a string that parses to a number (e.g. "1000" or "1e-10"), a big decimal or a number -or- another Time instance used to be subtracted from this time.
Time unit used as source for the conversion of value
. This defaults to "nanosecond" and is ignored when a
Time object is provided.
A Time object with the value of this time divided by the value of the other time.
Subtracts the value of another time from the value of this time. If either are approximations, the result will also be.
A value representing the length of time, accepted as a string that parses to a number (e.g. "1000" or "1e-10"), a big decimal or a number -or- another Time instance used to be subtracted from this time.
Time unit used as source for the conversion of value
. This defaults to "nanosecond" and is ignored when a
Time object is provided. Accepts plurals and case variations.
A Time object with the value of this time divided by the value of the other time.
Converts the value of this nanosecond-based time into any other time unit.
For the big decimal representation, see toBig.
Time unit used as target for the conversion.
Numeric representation of the converted time, measured using the given time unit.
Converts the value of this nanosecond-based time into any other time unit.
For the big decimal representation, see toBig.
Time unit used as target for the conversion. Accepts plurals and case variations.
Numeric representation of the converted time, measured using the given time unit.
Converts the value of this nanosecond-based time into any other time unit, using big decimals.
Time unit used as target for the conversion.
Big decimal representation of the converted time, measured using the given time unit.
Converts the value of this nanosecond-based time into any other time unit, using big decimals.
Time unit used as target for the conversion. Accepts plurals and care variations.
Big decimal representation of the converted time, measured using the given time unit.
Gets a string representing the of value of this time, in nanoseconds.
Numeric representation of the time length plus the symbol "ns".
Converts a time value, measuring it with the specified time unit, and creates a new Time instance with an equivalent length of time, but measured in nanoseconds.
A value representing the length of time, accepted as a string that parses to a number (e.g. "1000" or "1e-10"), a big decimal or a number.
Time unit used as source for the conversion.
A nanosecond-based time obtained from the conversion of the given parameters.
Converts a time value, measuring it with the specified time unit, and creates a new Time instance with an equivalent length of time, but measured in nanoseconds.
A value representing the length of time, accepted as a string that parses to a number (e.g. "1000" or "1e-10"), a big decimal or a number.
Time unit used as source for the conversion. Accepts plurals and case variations.
A nanosecond-based time obtained from the conversion of the given parameters.
Generated using TypeDoc
Encapsulates a nanosecond-based time value.
Instances of this class are capable of being converted from and to / to big decimal other time units and also perform basic arithmetics.
Times can also be approximated, and operations deriving from their use will also be approximated. This doesn't affect the time object value in any way, but is used by TimeWriter to demonstrate approximations.
All instances are immutable, thus not affected by methods (new instances are always created instead). Also, all time values are necessarily positive (negative times are not a thing).