@trendr/core 0.4.4 → 0.4.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/renderer.js +2 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trendr/core",
3
- "version": "0.4.4",
3
+ "version": "0.4.5",
4
4
  "description": "direct-mode TUI renderer with JSX, signals, and per-cell diffing",
5
5
  "license": "MIT",
6
6
  "author": "Jonathan Pyers",
package/src/renderer.js CHANGED
@@ -948,6 +948,7 @@ export function mount(rootComponent, { stream, stdin, title, theme, onExit: onEx
948
948
  let lastInlineBuf = null
949
949
 
950
950
  function frame() {
951
+ const frameStart = performance.now()
951
952
  const prevCtx = activeContext
952
953
  activeContext = ctx
953
954
  overlays = []
@@ -1076,7 +1077,7 @@ export function mount(rootComponent, { stream, stdin, title, theme, onExit: onEx
1076
1077
  }
1077
1078
  lastFrameTimestamp = now
1078
1079
  const avgMs = frameTimeWindow.length > 0 ? frameTimeWindow.reduce((a, b) => a + b, 0) / frameTimeWindow.length : 16.67
1079
- lastFrameStats = { changed, total: width * height, bytes: output ? Buffer.byteLength(output) : 0, fps: Math.round(1000 / avgMs) }
1080
+ lastFrameStats = { changed, total: width * height, bytes: output ? Buffer.byteLength(output) : 0, fps: Math.round(1000 / avgMs), renderMs: performance.now() - frameStart }
1080
1081
 
1081
1082
  const tmp = prev
1082
1083
  prev = curr