title: Angular 6 run a function in every X seconds
body: <p>I have a function called   </p>
  
  <p><code>opensnack(text) { ... };</code>    </p>
  
  <p>which is opening an <a href="https://material.angular.io/components/snack-bar/overview" rel="noreferrer">angular material snackbar</a> with the given text input.</p>
  
  <p>What I want to do is to call this function like every 10 seconds.  </p>
  
  <p>How should I do this?</p>