| 1 | = Duration (time) = |
| 2 | Visit [wiki:olivine/dsl/types/core core types] for information on ''whole number''. |
| 3 | |
| 4 | The duration type is used for expressing intervals of time. It is a unary post-fix operator, which means you specify any value that resolves to a `whole number` and then follow it by the name of a time unit. The possible time units are: |
| 5 | * `milliseconds` |
| 6 | * `seconds` |
| 7 | * `minutes` |
| 8 | * `hours` |
| 9 | * `days` |
| 10 | |
| 11 | Here are some self-explanatory examples: |
| 12 | {{{ |
| 13 | 5 days |
| 14 | 4 minutes |
| 15 | 2 milliseconds |
| 16 | }}} |
| 17 | |
| 18 | One oddity with this syntax is that you must specify the plural form even for a value of `1` for example: |
| 19 | {{{ |
| 20 | 1 seconds |
| 21 | 1 minutes |
| 22 | 1 days |
| 23 | 1 hours |
| 24 | }}} |
| 25 | |
| 26 | Here is a more complex example involving an expression, this one expresses a duration of 6 hours: |
| 27 | {{{ |
| 28 | (2 + 4) hours |
| 29 | }}} |
| 30 | |
| 31 | == Partial Durations == |
| 32 | You can add durations together (like other arithmetic values) to express partial time durations, this one for example expresses 2 minutes and 35 seconds: |
| 33 | |
| 34 | {{{ |
| 35 | 2 minutes + 35 seconds |
| 36 | }}} |