public class Duration extends Object implements ValueType:
Represents a duration of time.
This class provides methods to create and manipulate durations. It supports initialization from individual time components and provides arithmetic operations.
import klyn.time duration = Duration(0, 0, 0, 3600) print(duration.toString()) # Output: 1 h 0 m 0 s
@since 1.0
| Modifier and Type | Member | Description |
|---|---|---|
| public readonly property | totalSecondstotalSeconds as Double: |
Returns the total number of seconds in the duration. |
| Modifier and Type | Member | Description |
|---|---|---|
| public | Duration | Constructs a Duration object from individual time components. |
| Modifier and Type | Member | Description |
|---|---|---|
| public override | toString | Returns a string representation of this Duration. |
| Modifier and Type | Member | Description |
|---|---|---|
| public static | operator*(first as Duration, factor as Double) as Duration: | Multiplies a Duration by a numeric factor. |
| public static | operator+(first as Duration, second as Duration) as Duration: | Adds two Duration values. |
| public static | operator-(first as Duration, second as Duration) as Duration: | Subtracts two Duration values. |