Timer examples

Hi !
I think the title says it all,
I would like to see some timer examples,
just for fun =D

···

--
Mathspeedy <3 Linux and Ruby

Hi,

···

Am Mittwoch, 22. Jul 2009, 07:25:14 +0900 schrieb Mathspeedy:

I think the title says it all,
I would like to see some timer examples,

I examined the whole interpreter source code and could not find
any way to call alarm() or setitimer() by Ruby methods. I really
miss that!

Bertram

--
Bertram Scharpf
Stuttgart, Deutschland/Germany
http://www.bertram-scharpf.de

I have a simple timer library I use regularly. You can find the project page
here:

http://rubyforge.org/projects/actiontimer

and the source stuff on github:

···

On Tuesday 21 July 2009 15:25:14 Mathspeedy wrote:

Hi !
I think the title says it all,
I would like to see some timer examples,
just for fun =D

--
Mathspeedy <3 Linux and Ruby

Bertram Scharpf wrote:

Hi,

I think the title says it all,
I would like to see some timer examples,

I examined the whole interpreter source code and could not find
any way to call alarm() or setitimer() by Ruby methods. I really
miss that!

Bertram

There's a Timeout method I use that has been superior to anything I could find in Python, and was a reason for me using Ruby instead at one point:

    begin
        Timeout::timeout(OverallTimeout) do |tl|
            # Until I find out what this is, Screw it!
            # No doc on tl anymore!
            #puts "tl: #{tl}"
            probe_threads.each { |t| t.join }
            puts "All probe threads collected."
        end
    rescue Timeout::Error => eo
        puts "#{eo.message}, exiting before joining all probe threads."
    end

As you see by my comment above, some of the docs are not to my satisfaction. Still, I have been using this happily since 2007.

···

Am Mittwoch, 22. Jul 2009, 07:25:14 +0900 schrieb Mathspeedy:

--
They are the flesh. They are the bone.
They are the very cornerstone. - Janis Ian