Use time element

This commit is contained in:
2021-11-23 21:57:43 +09:00
parent 74d8f46b08
commit ad3ac4d880
22 changed files with 54 additions and 50 deletions

View File

@ -39,10 +39,10 @@ export default class MutationQueue {
}
private mutateAll() {
const start = performance.now()
const start = Date.now()
for(let i = 0; i < this.mutations.length; i++) {
if(performance.now() - start > timeCapacity) {
if(Date.now() - start > timeCapacity) {
this.mutations = this.mutations.slice(i)
window.requestAnimationFrame(() => this.mutateAll())
return