timer examples

Discussion in 'Ruby' started by Mathspeedy, Jul 21, 2009.

  1. Mathspeedy

    Mathspeedy Guest

    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
    Mathspeedy, Jul 21, 2009
    #1
    1. Advertising

  2. 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
    Bertram Scharpf, Jul 22, 2009
    #2
    1. Advertising

  3. Bertram Scharpf wrote:
    > 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
    >
    >

    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.
    --
    They are the flesh. They are the bone.
    They are the very cornerstone. - Janis Ian
    Xeno Campanoli, Jul 22, 2009
    #3
  4. Mathspeedy

    spox Guest

    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


    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:

    http://github.com/spox/actiontimer
    spox, Jul 22, 2009
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Daniel Maycock via .NET 247

    My Threading Timer Doesn't Fire

    Daniel Maycock via .NET 247, Mar 28, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    523
    steve
    Mar 30, 2005
  2. Kelsang Wangchuk

    System.Timers.Timer vs. System.Threading.Timer

    Kelsang Wangchuk, Jul 31, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    702
    Kelsang Wangchuk
    Jul 31, 2003
  3. Replies:
    1
    Views:
    1,574
    Steve C. Orr [MVP, MCSD]
    Feb 22, 2005
  4. Simon

    page timer, or redirect timer

    Simon, Nov 4, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    11,181
    Bruce Barker
    Nov 4, 2005
  5. Replies:
    8
    Views:
    477
    Jorgen Grahn
    Jul 15, 2013
Loading...

Share This Page