title: Smalltalk - Print something for each 2 seconds
body: <p>I'm coding in Smalltalk using Pharo. My code:</p>
  
  <pre><code>|i delay|
  i := 0.
  [i &lt; 5] whileTrue: [
      [
          delay := Delay forSeconds: 2.
          delay wait.
          Transcript show: '2 seconds are up'.
          Transcript cr.
      ] fork.
      i := i + 1.
  ]
  </code></pre>
  
  <p>It prints all the "2 seconds are up" at once, and not for each 2 seconds:</p>
  
  <pre><code>2 seconds are up
  2 seconds are up
  2 seconds are up
  2 seconds are up
  2 seconds are up
  </code></pre>
  
  <p>Please, can anyone tell me how to print something for each 2 seconds in Smalltalk?</p>