Skip to content

Home > resol-vbus-core > TimestampInterval

TimestampInterval class

A helper class managing timestamp-based interval events.

Signature:

typescript
export declare class TimestampInterval

Constructors

Constructor

Modifiers

Description

(constructor)(options)

Construct a timestamp interval.

Properties

Property

Modifiers

Type

Description

abortController

AbortController | null

The AbortController to stop the interval.

interval

number

The interval in milliseconds.

lastInterval

number | null

The last interval that fired.

onInterval?

(timestamp: Date) => void

(Optional) The callback to be called when an interval has passed.

Methods

Method

Modifiers

Description

isNewInterval(timestamp)

Determine whether a new interval has started.

start()

Start the realtime interval.

stop()

Stop the realtime interval.