From: Aaron Patterson Date: 2013-07-17T01:46:32+09:00 Subject: [ruby-core:56047] Re: [CommonRuby - Feature #8640] Add Time#elapsed to return nanoseconds since creation Hi Martin, On Tue, Jul 16, 2013 at 03:24:36PM +0900, duerst (Martin D�rst) wrote: > > Issue #8640 has been updated by duerst (Martin D�rst). > > > I think this is a good idea. But since > duration = Time.now - start > is in seconds, I'd either keep seconds as units, or make the use of nanoseconds explicit, e.g. like this: > duration = start.elapsed_nanoseconds I chose nanoseconds because it can be represented as an integer, so we don't need to allocate Ruby objects (plus all the other benefits integers buy us). So I'd really like to stick with nanoseconds as the unit. I'll propose both `elapsed` and `elapsed_nanoseconds` to matz. :-) -- Aaron Patterson http://tenderlovemaking.com/