Strict Standards: Non-static method phpbb_feed_factory::init() should not be called statically in /home/jacius/rubygame/forums/feed.php on line 66
[phpBB Debug] PHP Notice: in file /feed.php on line 171: Cannot modify header information - headers already sent by (output started at /feed.php:66)
[phpBB Debug] PHP Notice: in file /feed.php on line 172: Cannot modify header information - headers already sent by (output started at /feed.php:66)
Rubygame Forums 2009-07-09T13:53:16+00:00 http://rubygame.org/forums/feed.php?f=3&t=22 2009-07-09T13:53:16+00:00 http://rubygame.org/forums/viewtopic.php?t=22&p=195#p195 <![CDATA[Re: Help Rubygame: Clock Test]]>
My Ruby version:
ruby 1.8.7 (2009-06-08 patchlevel 173) [i686-linux]

Result:

samples = (0..100).collect { t = Time.now; sleep 0.01; Time.now - t }
# => [0.011282, 0.011982, 0.011981, 0.012019, 0.01197, 0.011995, 0.012002, 0.011995, 0.011992, 0.011996, 0.011997, 0.012, 0.011993, 0.012001, 0.011994, 0.011993, 0.011998, 0.011993, 0.01203, 0.012015, 0.011941, 0.011997, 0.011999, 0.011994, 0.011986, 0.01207, 0.011919, 0.012001, 0.011996, 0.011998, 0.011988, 0.011994, 0.011999, 0.011993, 0.011995, 0.012001, 0.011994, 0.011992, 0.011997, 0.011998, 0.011995, 0.012002, 0.012007, 0.01198, 0.011997, 0.012056, 0.011954, 0.012077, 0.011921, 0.012052, 0.011934, 0.011998, 0.012055, 0.011935, 0.011978, 0.011991, 0.011999, 0.011993, 0.011997, 0.011996, 0.011994, 0.011999, 0.011995, 0.011996, 0.011996, 0.011996, 0.011997, 0.011996, 0.011994, 0.012018, 0.012036, 0.011937, 0.011992, 0.011991, 0.011996, 0.011996, 0.011997, 0.011996, 0.011994, 0.011996, 0.011996, 0.012, 0.011993, 0.011993, 0.011997, 0.012003, 0.011996, 0.011991, 0.011993, 0.011997, 0.011996, 0.012001, 0.011997, 0.011992, 0.011996, 0.011994, 0.012, 0.011996, 0.011993, 0.011996, 0.011995]
avg = samples.inject(0){|m,i|m+i} / samples.length # => 0.0119883564356436
puts "avg: #{avg}; min: #{samples.min}; max: #{samples.max}"
avg: 0.0119883564356436; min: 0.011282; max: 0.012077

Statistics: Posted by shevegen — Thu Jul 09, 2009 1:53 pm


]]>
2009-07-02T08:53:07+00:00 http://rubygame.org/forums/viewtopic.php?t=22&p=182#p182 <![CDATA[Re: Help Rubygame: Clock Test]]> avg: 0.0100726732673267; min: 0.010033; max: 0.010314

Second test:
rg avg: 0.0102148118811881; min: 0.010031; max: 0.021441

Intel(R) Core(TM)2 Duo CPU E7300 @ 2.66GHz
Linux ubuntu 2.6.28-11-generic #42-Ubuntu SMP x86_64 GNU/Linux (Ubuntu 9.04)
ruby 1.8.7 (2008-08-11 patchlevel 72) [x86_64-linux]


Same system, but in Windows XP running in Virtualbox :-) :
avg: 0.0100792079207921; min: 0.009; max: 0.02

rg avg: 0.0101782178217822; min: 0.009; max: 0.029
(Ruby 186-27)

EDIT: woops, I am totally late to this party.

Statistics: Posted by antihcl — Thu Jul 02, 2009 8:53 am


]]>
2009-04-10T22:44:31+00:00 http://rubygame.org/forums/viewtopic.php?t=22&p=70#p70 <![CDATA[Re: Help Rubygame: Clock Test]]> irb(main):003:0> puts "avg: #{avg}; min: #{samples.min}; max: #{samples.max}"
avg: 0.0119784950495049; min: 0.007477; max: 0.016538

ruby 1.8.7 (2008-08-11 patchlevel 72) [i486-linux]
Ubuntu 8.10; CoreDuo @1.66GHz

Statistics: Posted by nlr — Fri Apr 10, 2009 10:44 pm


]]>
2009-04-02T21:48:35+00:00 http://rubygame.org/forums/viewtopic.php?t=22&p=63#p63 <![CDATA[Re: Help Rubygame: Clock Test]]> ruby 1.8.6 (2007-09-24 patchlevel 111) [i486-linux]

Using sleep:
avg: 0.0119922376237624; min: 0.008005; max: 0.015985

Using Clock.wait:
avg: 0.0100857821782178; min: 0.010035; max: 0.01063

Statistics: Posted by Cyrus — Thu Apr 02, 2009 9:48 pm


]]>
2009-03-15T20:20:58+00:00 http://rubygame.org/forums/viewtopic.php?t=22&p=51#p51 <![CDATA[Re: Help Rubygame: Clock Test]]> rg avg: 0.0103010594059406; min: 0.010028; max: 0.02898

Statistics: Posted by shawn42 — Sun Mar 15, 2009 8:20 pm


]]>
2009-03-15T18:52:24+00:00 http://rubygame.org/forums/viewtopic.php?t=22&p=50#p50 <![CDATA[Re: Help Rubygame: Clock Test]]> ruby 1.8.6 (2008-08-11 patchlevel 287) [i386-mswin32]
avg: 0.0106732673267327; min: 0.0; max: 0.016

Statistics: Posted by shawn42 — Sun Mar 15, 2009 6:52 pm


]]>
2009-03-15T18:47:44+00:00 http://rubygame.org/forums/viewtopic.php?t=22&p=49#p49 <![CDATA[Re: Help Rubygame: Clock Test]]> avg: 0.0100987425742574; min: 0.010034; max: 0.010619

Statistics: Posted by shawn42 — Sun Mar 15, 2009 6:47 pm


]]>
2009-03-15T18:39:01+00:00 http://rubygame.org/forums/viewtopic.php?t=22&p=48#p48 <![CDATA[Re: Help Rubygame: Clock Test]]> ruby 1.9.1p0 (2009-01-30 revision 21907) [i386-darwin9.6.0]
avg: 0.0101205049504951; min: 0.010046; max: 0.010638

Statistics: Posted by shawn42 — Sun Mar 15, 2009 6:39 pm


]]>
2009-03-15T18:36:16+00:00 http://rubygame.org/forums/viewtopic.php?t=22&p=47#p47 <![CDATA[Help Rubygame: Clock Test]]>
But before I do that, I'd like to gather sample data about the granularity of ruby's sleep method on different computers. It would be very helpful if I could get as many people as possible to run this bit of code through IRB and paste the output here, along with your operating system and processor type/speed [edit: and ruby version, please]. :)

Code:
samples = (0..100).collect { t = Time.now; sleep 0.01; Time.now - t }
avg = samples.inject(0){|m,i|m+i} / samples.length
puts "avg: #{avg}; min: #{samples.min}; max: #{samples.max}"

For example, my info would be:

avg: 0.0100623168316832; min: 0.010035; max: 0.010113
Gentoo Linux; AMD Phenom 2.6Ghz Quad (in 32 bit emulation)
ruby 1.8.6 (2008-08-11 patchlevel 287) [i686-linux]

Edit: Also, it would be illuminating if you could run this version, too, with any version of Rubygame:

Code:
require "rubygame"
samples = (0..100).collect {t = Time.now; Rubygame::Clock.wait(10); Time.now - t}
avg = samples.inject(0){|m,i|m+i} / samples.length
puts "rg avg: #{avg}; min: #{samples.min}; max: #{samples.max}"

Statistics: Posted by jacius — Sun Mar 15, 2009 6:36 pm


]]>