BACK
ReferencetimeInterval
Reference · 111

timeInterval

timeInterval

rxjs.dev

Attaches to each value the time since the previous emission.

Signature

timeInterval(): OperatorFunction>

What it does

Wraps the value in a TimeInterval object: { value, interval }. interval shows how many milliseconds passed since the previous next.

When to use

Measuring event frequency, diagnosing delays, simple stream telemetry.

See also

timestamp, tap

script.ts // TypeScript
CONSOLE · Console output
Hit Run to see the result...