fixed time tracking

This commit is contained in:
matt 2021-07-30 17:07:44 +00:00
parent f9f5b01cc2
commit d7d748e05a
1 changed files with 2 additions and 2 deletions

View File

@ -2252,14 +2252,14 @@ export default class RFB extends EventTargetMixin {
let first, ret; let first, ret;
switch (msgType) { switch (msgType) {
case 0: // FramebufferUpdate case 0: // FramebufferUpdate
let before = Date.now(); let before = performance.now();
this._display.renderMs = 0; this._display.renderMs = 0;
ret = this._framebufferUpdate(); ret = this._framebufferUpdate();
if (ret && !this._enabledContinuousUpdates) { if (ret && !this._enabledContinuousUpdates) {
RFB.messages.fbUpdateRequest(this._sock, true, 0, 0, RFB.messages.fbUpdateRequest(this._sock, true, 0, 0,
this._fbWidth, this._fbHeight); this._fbWidth, this._fbHeight);
} }
let elapsed = Date.now() - before; let elapsed = performance.now() - before;
if (this._trackFrameStats) { if (this._trackFrameStats) {
RFB.messages.sendFrameStats(this._sock, elapsed, this._display.renderMs); RFB.messages.sendFrameStats(this._sock, elapsed, this._display.renderMs);
this._trackFrameStats = false; this._trackFrameStats = false;