Skip to main content
Integrate power, current and voltage over a caller-supplied window. Every reading is an average over time, not an instant sample.

Handle

Methods

Types

WattReading

Method Reference

power(duration: f64) -> Result<f64>

Mean power over duration seconds.
Parameters: Returns: f64 — mean power in watts.

current(duration: f64) -> Result<f64> and voltage(duration: f64) -> Result<f64>

Mean current in amps and mean voltage in volts over the same kind of window. Both need a meter that actually reports that quantity — a Joulescope or PPK2 does, a power-only meter does not.

all(duration: f64) -> Result<WattReading>

Current, voltage and power gathered in a single instrument transaction. Prefer this over three separate calls: it is one window rather than three, so the numbers describe the same moment.

Examples

Compare sleep current against a budget

Supported Hardware

Notes

  • There is no default window. The Rust API requires an explicit duration, unlike the CLI, which defaults to 0.1.
  • The client widens its HTTP budget to max(30, duration + 20) seconds, so a long window does not trip the ordinary 10-second timeout.
  • A window is a real wait. power(5.0) blocks your test for five seconds.
  • Fields on WattReading are Option because a meter may not report all three; a None is “this instrument does not measure that”, not a failure.