|
|
## In Short
|
|
|
TimeSpan refers to a time duration or delta between to simulation times (i.e. [TimeStamps](./TimeStamp)).
|
|
|
It can be used to create new TimeStamps based on others by shifting them by a certain time duration.
|
|
|
|
|
|
## Details
|
|
|
TimeSpan is implemented using a single long value and thus representing the delta between two TimeStamps (and their respective representations as long values).
|
|
|
TimeSpans are immutable, thus they cannot be changed after creation.
|
|
|
TimeSpans that refer to the same amount of steps are regarded equal for all aspects (comparison, equality, hashing), even if they correspond to different objects.
|
|
|
|
|
|
TimeSpans are always positive.
|
|
|
However, they can be used to shift TimeStamps to the future or to the past using `TimeStamp.laterBy` and `TimeStamp.earlierBy` methods.
|
|
|
|
|
|
TimeSpans can either be created by specifying their duration in seconds, or, more expressively, by providing a natural time Interval (e.g. MINUTES, HOURS, MONTHS) and a count of how many of these intervals are to be used.
|
|
|
TimeSpans can also be combined to a new TimeSpan representing the sum of all the combined durations. |
|
|
\ No newline at end of file |