title: ruby - start a thread
body: <p>I am new to ruby and trying to work around threads</p>
  
  <p>Let's say I have a method which I want to run every <strong>x seconds</strong> as follows</p>
  
  <pre><code>def say_hello
      puts 'hello world'
  end
  </code></pre>
  
  <p>I am trying to run it as follows</p>
  
  <pre><code>Thread.new do
      while true do
          say_hello
          sleep(5)
      end
  end
  </code></pre>
  
  <p>But when I run the script, nothing is displayed on the console. What am I missing? Thanks!</p>