Phrogz wrote:
> On Oct 30, 10:40 am, Bertram Scharpf <li... / bertram-scharpf.de> wrote:
>>   irb(main):001:0> def timer ; start = Time.now ; yield ; Time.now - start ; end
>>   => nil
>>   irb(main):002:0> index = 2
>>   => 2
>>   irb(main):003:0> timer do 100_000.times { "hello"[-index..-1] } end
>>   => 0.888826
>>   irb(main):004:0> timer do 100_000.times { "hello".tail index } end
>>   => 0.21357
>>
>> Your calculation needs more than four times as much processor
>> time. Don't you need to save time?
> 
> Really? You're arguing about the efficiency of something that is about
> 6.8 slower?

You took that personally, really?

> I don't personally need to save the time. Nor do you, unless you have
> a real-world program using this method that you have benchmarked and
> found this particular method call to be a significant portion of your
> execution time.
> 
> 


-- 
Kind Regards,
Rajinder Yadav

http://DevMentor.org

Do Good! - Share Freely, Enrich and Empower people to Transform their lives.