reliable_interval_timer 1.0.2 copy "reliable_interval_timer: ^1.0.2" to clipboard
reliable_interval_timer: ^1.0.2 copied to clipboard

A timer that produces ticks within a given interval, accurate to the millisecond.

example/reliable_interval_timer_example.dart

import 'package:reliable_interval_timer/reliable_interval_timer.dart';

const intervalInMilliseconds = 250;

int ticks = 0;

void main() {
  var timer = ReliableIntervalTimer(
    interval: Duration(milliseconds: intervalInMilliseconds),
    callback: onTimerTick,
  );

  timer.start().then((_) {
    print('Timer started');
  });
}

void onTimerTick(int elapsedMilliseconds) {
  ticks++;

  print('Tick #$ticks after $elapsedMilliseconds');
}
copied to clipboard
8
likes
150
points
133
downloads

Publisher

unverified uploader

Weekly Downloads

2024.07.08 - 2025.01.20

A timer that produces ticks within a given interval, accurate to the millisecond.

Repository (GitHub)

Documentation

API reference

License

BSD-3-Clause (license)

More

Packages that depend on reliable_interval_timer