From: Aaron Patterson Date: 2013-07-18T02:56:23+09:00 Subject: [ruby-core:56066] Re: [CommonRuby - Feature #8640] Add Time#elapsed to return nanoseconds since creation On Wed, Jul 17, 2013 at 01:04:37PM +0900, phluid61 (Matthew Kerwin) wrote: > > Issue #8640 has been updated by phluid61 (Matthew Kerwin). > > > nobu (Nobuyoshi Nakada) wrote: > > You propose the method not to take any arguments? > > I had supposed that you'd wanted the keyward argument. > > Since the discussion has moved towards defining two separate methods {#elapsed => (float)s and #elapsed_nanoseconds => (int)ns} I do prefer a keyword argument {in: :nanoseconds}. Sorry for wavering back and forth on the issue so noisily. I don't care if a method exists that has kw args, but I would not use it. The things we need to time in Rails are fairly fast (say 200ms on the slow side) and happen frequently, which means that object allocations matter. A kwarg method will end up allocating a hash on every call. If someone else wants to make a method with kwargs, I think that's great, but it's not what I'm pushing for here. My point is to reduce object allocations. :-) -- Aaron Patterson http://tenderlovemaking.com/