Did I find the right examples for you? yes no

All Samples(4)  |  Call(2)  |  Derive(0)  |  Import(2)
Repeating timer. Returns a thread id.

        def RepeatTimer(interval, function, iterations=0, *args, **kwargs):
  """Repeating timer. Returns a thread id."""

  def __repeat_timer(interval, function, iterations, args, kwargs):
    """Inner function, run in background thread."""
    count = 0
    while iterations <= 0 or count < iterations:
      sleep(interval)
      function(*args, **kwargs)
      count += 1

  return start_new_thread(__repeat_timer, (interval, function, iterations, args, kwargs))
        


src/s/c/scales-1.0.6/src/greplin/scales/meter.py   scales(Download)
  from collections import UserDict
from greplin.scales import Stat
from greplin.scales.timer import RepeatTimer
from greplin.scales.util import EWMA
 
TICKERS = []
TICKER_THREAD = RepeatTimer(5, lambda: [t() for t in TICKERS])

src/s/c/scales-HEAD/src/greplin/scales/meter.py   scales(Download)
  from collections import UserDict
from greplin.scales import Stat
from greplin.scales.timer import RepeatTimer
from greplin.scales.util import EWMA
 
TICKERS = []
TICKER_THREAD = RepeatTimer(5, lambda: [t() for t in TICKERS])