Skip to content
CCPEDIAby Unity Nodes
App Development

How to multiply `RelTime`

2 posts182 views5 likesLast activity Nov 2022

  1. Arne_GebertOP 1

    I have a RelTime duration that I would like to multiply by some value to scale it. So, what I would like to do is:

    import DA.Time
    let five = seconds 5
    let fiveteen = five * 3
    

    Is there an obvious to do so via the standard library that I am missing?

    Thanks!
    Arne

  2. cocreature 4

    Nothing builtin I believe. I think your best option is conversion from/to microseconds:

    multiplyRelTime : Int -> RelTime -> RelTime
    multiplyRelTime n t = convertMicrosecondsToRelTime (n * convertRelTimeToMicroseconds t)