Skip to content

Commit

Permalink
style: remove unused stopwatch
Browse files Browse the repository at this point in the history
  • Loading branch information
Tienisto committed Nov 2, 2024
1 parent 1b2673c commit 9a7a96d
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions rhttp/lib/src/util/stream_listener.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,11 @@ Future<void> listenToStreamWithBackpressure({
required Future<void> Function(Uint8List) onData,
required Future<void> Function() onDone,
}) async {
final stopWatch = Stopwatch()..start();

final bytesBuilder = BytesBuilder(copy: false);
await for (final chunk in stream) {
bytesBuilder.add(chunk);

if (bytesBuilder.length > _bufferSize) {
stopWatch.reset();
await onData(bytesBuilder.takeBytes());
}
}
Expand Down

0 comments on commit 9a7a96d

Please sign in to comment.