`core.time.Duration` has a `total` function for extracting the value withing the Duration. `total` returns a whole number (`long`). Is there a function that returns a decimal (`double` or `float`)?

I cannot find one in `core.time`.  How would I do it then?
I know I can get finer precision (say msecs) and then divide it to get a courser precision (say secs) but then I might loose some potential accuracy. I could do nsecs but that could be finer than than the actual internal number and therefore cause extra calculation or end up truncating really large numbers.

I would think a function that this would be appropriate to belong in the module. Am I missing it? Or, how would you recommend calculating it?

tldr: I am looking for a function like `double as(string units)(Duration)`.

Reply via email to