A structure which represents a time span.
Remarks
This is a convertible type that can be used with the following notation(s) in parameter lists, parameter objects or setters.
There are some string formats that are converted to TimeSpan. For example:
'1s'
'0.5m'
'1h'
'1h 20m'
'1:20'
'1:20:30.5'
It is also possible to use a number which will be interpreted in milliseconds.
Type Details
- yFiles module
- core
See Also
Constructors
Creates a new time span with a given length.
Parameters
A map of options to pass to the method.
- days - number
- The days part of the time span.
- hours - number
- The hour part of the time span.
- minutes - number
- The minute part of the time span.
- seconds - number
- The seconds part of the time span.
- millis - number
- The milliseconds part of the time span.
Properties
Methods
Compares this object to the given object of the same type.
Parameters
A map of options to pass to the method.
- obj - any
- The object to compare this to.
Returns
- ↪number
- -1: this is less than
obj
- 0: this is equal to
obj
- 1: this is greater than
obj
- -1: this is less than
Implements
Returns a hash code for this object.
Remarks
The hash code is a numeric value that can be used to treat this object as a key in a hash table or similar data structure.
Two objects that are considered equal must have the same hash code. However, the reverse does not hold and two objects having the same hash code don't have to be equal. Ideally, the hash code should be roughly uniformly-distributed to prevent hash tables from performing poorly. Calculating the hash code is also a potentially frequent operation and should therefore be fast.
Returns
- ↪number
- the hash code for this object
Static Methods
Creates a TimeSpan instance from the given object by performing automatic type conversion.