diff options
Diffstat (limited to 'ui/html/main.js')
-rw-r--r-- | ui/html/main.js | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/ui/html/main.js b/ui/html/main.js index 5f3b5a5..0c25c5f 100644 --- a/ui/html/main.js +++ b/ui/html/main.js @@ -22,13 +22,14 @@ class View { event.listen('__update__', this.appAction.bind(this)); event.emit('__action__', '__init__'); while (true) { + let now = Date.now(); try { await this.update(); this.render(); } catch (e) { console.error(e); } - await new Promise(r => setTimeout(r, 100)); + await new Promise(r => setTimeout(r, Math.max(0, 33 - (Date.now() - now)))); } } async update() { |