josedonizetti / ruby-duration

Immutable type that represents some amount of time with accuracy in seconds.
http://bit.ly/ruby-duration
MIT License
124 stars 23 forks source link

miliseconds #17

Open benlieb opened 10 years ago

benlieb commented 10 years ago

Di you plan on implementing miliseconds? I started using this for an ffmpeg video editing project, and a lot can happen in a second on film. Ffmpeg has a function that tells you where a video fades to black at say at second 3535.3432. I wanted to store and manipulate these as Duration objects, but it's just not fine grained enough. Seem like a useful thing to have.

Any thoughts?

benlieb commented 9 years ago

I've come back to check on this. If I submitted a pull request would you be interested in this functionality?

peleteiro commented 9 years ago

Not really. Adding microseconds would make this incompatible with ISO_8601.

pkaeding commented 9 years ago

I'm curious how supporting milliseconds would break compatibility with ISO 8601 durations? From the Wikipedia article linked above:

The smallest value used may also have a decimal fraction, as in "P0.5Y" to indicate half a year.

Thus, 237ms could be expressed in a ISO 8601-compatible format as P0.237S.

peleteiro commented 9 years ago

My mistake, you're right. I'm fine with microseconds. You can submit the PR.

benlieb commented 6 years ago

I've come come back again to check on this, haha. But I guess neither I nor anyone else has had the time to implement micro / milliseconds. :(

peleteiro commented 6 years ago

I don't use ruby either this lib anymore. If someone else wants to implement microseconds and/or take over the project let me know.