Skip to content

CostTracker

CostTracker represents the information needed for tracking runtime cost.

new CostTracker(options?): CostTracker

constructor initializes a runtime cost tracker.

CostTrackerOptions = {}

CostTracker

actualCost(): number

actualCost returns the runtime cost.

number


clone(): CostTracker

clone makes a shallow copy of the tracker.

Different clones can be used independently from each other. Accumulated cost and stack state are intentionally reset.

CostTracker


observe(options): void

observe computes the incremental cost of a step and records it in this tracker.

number

unknown

Val

void