timestampedqueue 1.0.1 copy "timestampedqueue: ^1.0.1" to clipboard
timestampedqueue: ^1.0.1 copied to clipboard

Provides a queue to whose entries have a timestamp, so that it is possible to get when happened the last occurrence of an state or if a sequence of states has happened in a period of time.

example/timestampedqueue_example.dart

import 'dart:io';
import 'package:timestampedqueue/timestampedqueue.dart';

void main() {
  TimestampedQueue<int> queue = TimestampedQueue()..add(0);

  for (var element in [1,3,5,1,3,5,1,5,8,5]) {
    queue.add(element);
    sleep(Duration(milliseconds: 5));
  }

  print(queue.sequenceFind([1,5], timeDone: 10));
  print(queue.lastSequenceDone([1,5,8,5]));
  print(queue);
  print(queue.slice(1, 4));
}
0
likes
140
points
2
downloads

Publisher

unverified uploader

Weekly Downloads

Provides a queue to whose entries have a timestamp, so that it is possible to get when happened the last occurrence of an state or if a sequence of states has happened in a period of time.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (license)

More

Packages that depend on timestampedqueue