Add r3f stress + Ticker.__ticks counter

This commit is contained in:
Cole Lawrence 2022-07-29 11:59:39 -04:00
parent ea3e7434c6
commit 62def1e883
6 changed files with 1341 additions and 2 deletions

View file

@ -42,6 +42,11 @@ export default class Ticker {
private _scheduledForNextTick: Set<ICallback>
private _timeAtCurrentTick: number
private _ticking: boolean = false
/**
* Counts up for every tick executed.
* Internally, this is used to measure ticks per second.
*/
public __ticks = 0
constructor() {
this._scheduledForThisOrNextTick = new Set()
@ -127,6 +132,9 @@ export default class Ticker {
)
}
}
this.__ticks++
this._ticking = true
this._timeAtCurrentTick = t
for (const v of this._scheduledForNextTick) {