@@ -137,7 +137,7 @@ export class WriteBuffer extends Disposable {
137137 * effectively lowering the redrawing needs, schematically:
138138 *
139139 * macroTask _innerWrite:
140- * if (Date .now() - (lastTime | 0) < WRITE_TIMEOUT_MS):
140+ * if (performance .now() - (lastTime | 0) < WRITE_TIMEOUT_MS):
141141 * schedule microTask _innerWrite(lastTime)
142142 * else:
143143 * schedule macroTask _innerWrite(0)
@@ -158,7 +158,7 @@ export class WriteBuffer extends Disposable {
158158 * Note, for pure sync code `lastTime` and `promiseResult` have no meaning.
159159 */
160160protected _innerWrite ( lastTime :number = 0 , promiseResult :boolean = true ) :void {
161- const startTime = lastTime || Date . now ( ) ;
161+ const startTime = lastTime || performance . now ( ) ;
162162while ( this . _writeBuffer . length > this . _bufferOffset ) {
163163const data = this . _writeBuffer [ this . _bufferOffset ] ;
164164const result = this . _action ( data , promiseResult ) ;
@@ -186,7 +186,7 @@ export class WriteBuffer extends Disposable {
186186 * responsibility to slice hard work), but we can at least schedule a screen update as we
187187 * gain control.
188188 */
189- const continuation :( r :boolean ) => void = ( r :boolean ) => Date . now ( ) - startTime >= WRITE_TIMEOUT_MS
189+ const continuation :( r :boolean ) => void = ( r :boolean ) => performance . now ( ) - startTime >= WRITE_TIMEOUT_MS
190190 ?setTimeout ( ( ) => this . _innerWrite ( 0 , r ) )
191191 :this . _innerWrite ( startTime , r ) ;
192192
@@ -202,7 +202,7 @@ export class WriteBuffer extends Disposable {
202202 * throughput by eval'ing `startTime` upfront pulling at least one more chunk into the
203203 * current microtask queue (executed before setTimeout).
204204 */
205- // const continuation: (r: boolean) => void =Date .now() - startTime >= WRITE_TIMEOUT_MS
205+ // const continuation: (r: boolean) => void =performance .now() - startTime >= WRITE_TIMEOUT_MS
206206// ? r => setTimeout(() => this._innerWrite(0, r))
207207// : r => this._innerWrite(startTime, r);
208208
@@ -222,7 +222,7 @@ export class WriteBuffer extends Disposable {
222222this . _bufferOffset ++ ;
223223this . _pendingData -= data . length ;
224224
225- if ( Date . now ( ) - startTime >= WRITE_TIMEOUT_MS ) {
225+ if ( performance . now ( ) - startTime >= WRITE_TIMEOUT_MS ) {
226226break ;
227227}
228228}