Skip to content
CCPEDIAby Unity Nodes
Discussions/App Development/How to multiply `RelTime`Forum ↗

How to multiply `RelTime`

App Development2 posts151 views5 likesLast activity Nov 2022
AR
Arne_GebertOP
Nov 2022

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

CO
cocreature
Nov 2022

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)
← Back to Discussions