title: How to make code run once inside background task looping?
body: <p>I have a background Task looping looks like this:</p>
  
  <pre><code>Timeline fiveSecondsWonder = new Timeline(new KeyFrame(Duration.seconds(1), event -&gt; {
       if (hourNow &gt;= cashCutOff_Start &amp;&amp; hourNow &lt;= cashCutOff_End - 1) {
  //Run the code once
  }
  }));
  fiveSecondsWonder.setCycleCount(Timeline.INDEFINITE);
  fiveSecondsWonder.play();
  </code></pre>
  
  <p>This code does make loop every one second. But I want to make a single line of code executable once this code run. </p>