countOnWindow

suspend fun <T> Flow<T>.countOnWindow(duration: Duration): Int

Counts the number of items emitted by the flow within the specified duration window.

Return

The number of items emitted by the flow within the specified duration.

Parameters

duration

The duration of the counting window.