Examples
banshee/examples-collection/examples/mechanics/
wait
Example: time.wait, two readings within one pass; the CPU usage of a Linux.
par banshee1 installation1 version
Publiée le 27 octobre 2026. First version in this collection.
Waiting within a pass
time.wait waits inside a pass. Here, two readings of the CPU counters of a Linux, five seconds apart, give the CPU usage at the first pass already, where counter.rate waits for the next pass.
How to read it
time.wait(5): five seconds, counted in the time the collector is allowed for a pass. A pass that goes beyond it stops, unreachable.cpu_timesreturns an array of two keys, read as$before['idle']: a function returns one value, and an array carries several.- The first line of
/proc/stat,cpu, sums every core, in hundredths of a second since the start: idle isidleplusiowait.
To adapt it
- A wait makes every pass longer: across many probes,
counter.rateis lighter (seeexamples/mechanics/counter-rate).