UNPKG

@100mslive/hms-video-store

Version:

@100mslive Core SDK which abstracts the complexities of webRTC while providing a reactive store for data management with a unidirectional data flow

19 lines (15 loc) 274 B
export class RunningAverage { private total = 0; private count = 0; add(item: number) { this.count++; this.total += item; } getAvg(): number { return Math.floor(this.total / this.count); } reset() { this.total = 0; this.count = 0; } }