title: Ensuring minimum update frequency of a pyglet application
body: <p>Function calls triggered by <code>pyglet.clock.schedule_interval()</code> seem to occur at <em>extremely</em> variable time intervals after the pyglet window is hidden/minimized (this is on macOS Catalina, in case it matters).</p>
  <p>Below is a minimal example that should print out a number not much greater than 0.5 every half second. Instead, after a few seconds of the window being minimized, calls are delayed by up to 10 seconds.</p>
  <p>I'm (baselessly) assuming this is because pyglet is designed to function with lower priority when the window is not visible. I dont really care if my functions calls occur every 0.6 seconds instead of 0.5, but a 10s lag seems unreasonably large.</p>
  <p>Is there a simple way to ensure pyglet maintains a high priority and/or does not drastically alter the frequency of scheduled calls?</p>
  <pre class="lang-py prettyprint-override"><code>import pyglet
  
  window = pyglet.window.Window(width = 128, height = 128)
  
  @window.event
  def on_draw():
      window.clear()
  
  def foo(t):
      print(t)
  
  pyglet.clock.schedule_interval(foo, 0.5)
  pyglet.app.run()
  </code></pre>
  <p>Typical output below:</p>
  <pre><code>0.5010913940000137
  8.22102221900002
  10.501081690999968
  10.501448707999998
  10.501421234999953
  3.7303194810000377
  10.501095133000035
  0.5011976460000369
  10.501220476999947
  10.501225187000045
  4.144422970999926
  </code></pre>