(13/07/16 20:37), phluid61 (Matthew Kerwin) wrote:
> nobu (Nobuyoshi Nakada) wrote:
>> phluid61 (Matthew Kerwin) wrote:
>>
>>> I wouldn't complain if there was a kwarg, although I'm not sure which way it should switch:  time_obj.elapsed(float: true) or time_obj.elapsed(nanoseconds: true)
>>
>> time_obj.elapsed(in: :nanoseconds) ?
> 
> I had considered that, but I wonder if people aren't going to ask for (or expect) support for :milliseconds, :hours, :days, :aztec_great_cycles, etc.  The rules about which symbols are valid seems a little arbitrary.

Your points are all true for {nanoseconds: true} too.

And if support for milliseconds is implemented, what would you expect from elapsed(nanoseconds: true, milliseconds: true)?

> And then I suppose the question could become: why are nanoseconds an integer, but seconds a float?

Ditto.

> And why doesn't Time#- accept the same kwarg?

Ditto.

And it's because of the operator syntax.

> And so on with the bike-shedding.  I don't know a good answer for most of these hypothetical questions, so I guess the short-term solution would be to make #elapsed be a short-cut for `Time.now - self`, and return a float number of seconds.

You propose the method not to take any arguments?
I had supposed that you'd wanted the keyward argument.