Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > 1.9 Missing method? Time#times

Reply
Thread Tools

1.9 Missing method? Time#times

 
 
jzakiya
Guest
Posts: n/a
 
      12-25-2007
I was running the files in the 1.9.0 /samples directory and incurred a
"`<main>': undefined method `times' for Time:Class (NoMethodError)"

time.rb

#! /usr/local/bin/ruby
cmd = ARGV.join(" ")
b = Time.now
system(cmd)
e = Time.now
ut, st, cut, cst = Time.times.to_a
total = (e - b).to_f
STDERR.printf "%11.1f real %11.1f user %11.1f sys\n", total, cut, cst

I did a Time.methods, and sure enough it's there in 1.8.6 but not
1.9.0.

Is this an oversight, or is this now deliberately deprecated behavior?
How would you do the equivalent in 1.9.0 if deprecated?


 
Reply With Quote
 
 
 
 
Michael Fellinger
Guest
Posts: n/a
 
      12-26-2007
On Dec 26, 2007 8:44 AM, jzakiya <> wrote:
> I was running the files in the 1.9.0 /samples directory and incurred a
> "`<main>': undefined method `times' for Time:Class (NoMethodError)"
>
> time.rb
>
> #! /usr/local/bin/ruby
> cmd = ARGV.join(" ")
> b = Time.now
> system(cmd)
> e = Time.now
> ut, st, cut, cst = Time.times.to_a
> total = (e - b).to_f
> STDERR.printf "%11.1f real %11.1f user %11.1f sys\n", total, cut, cst
>
> I did a Time.methods, and sure enough it's there in 1.8.6 but not
> 1.9.0.
>
> Is this an oversight, or is this now deliberately deprecated behavior?
> How would you do the equivalent in 1.9.0 if deprecated?


manveru@sigma ~ % irb
Time.times
(irb):1: warning: obsolete method Time::times; use Process::times
# #<struct Struct::Tms utime=0.08, stime=0.02, cutime=0.0, cstime=0.0>

 
Reply With Quote
 
 
 
 
jzakiya
Guest
Posts: n/a
 
      12-26-2007
On Dec 25, 7:14 pm, Michael Fellinger <m.fellin...@gmail.com> wrote:
> On Dec 26, 2007 8:44 AM, jzakiya <jzak...@mail.com> wrote:
>
>
>
> > I was running the files in the 1.9.0 /samples directory and incurred a
> > "`<main>': undefined method `times' for Time:Class (NoMethodError)"

>
> > time.rb

>
> > #! /usr/local/bin/ruby
> > cmd = ARGV.join(" ")
> > b = Time.now
> > system(cmd)
> > e = Time.now
> > ut, st, cut, cst = Time.times.to_a
> > total = (e - b).to_f
> > STDERR.printf "%11.1f real %11.1f user %11.1f sys\n", total, cut, cst

>
> > I did a Time.methods, and sure enough it's there in 1.8.6 but not
> > 1.9.0.

>
> > Is this an oversight, or is this now deliberately deprecated behavior?
> > How would you do the equivalent in 1.9.0 if deprecated?

>
> manveru@sigma ~ % irb
> Time.times
> (irb):1: warning: obsolete method Time::times; use Process::times
> # #<struct Struct::Tms utime=0.08, stime=0.02, cutime=0.0, cstime=0.0>


Yes

Replacing Process.times for Time.times in the file time.rb
for 1.9 performs the same as in 1.8.6.

Thanks
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Crystal Reports - Visual Basic UFL that implements this function is missing (or U2lcom.dll is missing) Les Caudle ASP .Net 3 09-03-2007 02:27 AM
Re: missing feature classes and missing fields Gary Herron Python 2 07-04-2006 10:29 PM
missing wzcdlg.dll =?Utf-8?B?RGFuZGVl?= Wireless Networking 4 11-20-2004 02:14 PM
Missing Wireless Link applet =?Utf-8?B?Q2hyaXNzaWU=?= Wireless Networking 8 10-07-2004 07:24 PM
Missing Websites and no mail =?Utf-8?B?U2hpZnR3b3JrZXI0Mw==?= Wireless Networking 0 09-11-2004 12:31 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57