Changes between Initial Version and Version 1 of olivine/dsl/types/duration


Ignore:
Timestamp:
May 21, 2020 10:11:50 PM (4 years ago)
Author:
jonathan
Comment:

Page introduction

Legend:

Unmodified
Added
Removed
Modified
  • olivine/dsl/types/duration

    v1 v1  
     1= Duration (time) =
     2Visit [wiki:olivine/dsl/types/core core types] for information on ''whole number''.
     3
     4The 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
     11Here are some self-explanatory examples:
     12{{{
     135 days
     144 minutes
     152 milliseconds
     16}}}
     17
     18One oddity with this syntax is that you must specify the plural form even for a value of `1` for example:
     19{{{
     201 seconds
     211 minutes
     221 days
     231 hours
     24}}}
     25
     26Here 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 ==
     32You 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{{{
     352 minutes + 35 seconds
     36}}}