yRunLoop function

Timer yRunLoop(
  1. dynamic action(
    1. Timer? timer
    ),
  2. int loop, {
  3. dynamic runNow = false,
})

主线程运行(循环)

Implementation

Timer yRunLoop(Function(Timer? timer) action, int loop, {runNow = false}) {
  if (runNow) action(null);
  return Timer.periodic(Duration(milliseconds: loop), (timer) => action(timer));
}