asStream static method

Stream<CpuInfo> asStream(
  1. Duration duration
)

Listens to any updates of the CPU reader

Implementation

static Stream<CpuInfo> asStream(Duration duration) async* {
  while (true) {
    await Future.delayed(duration);
    CpuInfo info = await CpuReader.cpuInfo;
    yield info;
  }
}