MCPcopy Index your code
hub / github.com/CapSoftware/Cap / recordRender

Function recordRender

apps/desktop/src/utils/socket.ts:1116–1144  ·  view source on GitHub ↗
(
		durationMs: number,
		mode: FpsStats["transportMode"],
		timing?: WebGPURenderTiming,
		receivedAt?: number,
	)

Source from the content-addressed store, hash-verified

1114 let transportMode: FpsStats["transportMode"] = "pending";
1115
1116 function recordRender(
1117 durationMs: number,
1118 mode: FpsStats["transportMode"],
1119 timing?: WebGPURenderTiming,
1120 receivedAt?: number,
1121 ) {
1122 transportMode = mode;
1123 actualRendersCount++;
1124 const renderMs = timing?.totalMs ?? durationMs;
1125 if (renderMs > 0) {
1126 renderTimeSum += renderMs;
1127 renderTimeCount++;
1128 maxRenderMs = Math.max(maxRenderMs, renderMs);
1129 }
1130 if (timing) {
1131 uploadTimeSum += timing.uploadMs;
1132 uploadTimeCount++;
1133 maxUploadMs = Math.max(maxUploadMs, timing.uploadMs);
1134 }
1135 if (receivedAt !== undefined) {
1136 const receiveToDisplayMs = performance.now() - receivedAt;
1137 receiveToDisplaySum += receiveToDisplayMs;
1138 receiveToDisplayCount++;
1139 maxReceiveToDisplayMs = Math.max(
1140 maxReceiveToDisplayMs,
1141 receiveToDisplayMs,
1142 );
1143 }
1144 }
1145
1146 const resetStatsWindow = (now: number) => {
1147 frameCount = 0;

Callers 6

renderPendingNv12FrameFunction · 0.85
renderPendingRgbaFrameFunction · 0.85
renderNv12FrameCanvas2DFunction · 0.85
ensureStrideWorkerFunction · 0.85
renderRgbaFrameCanvas2DFunction · 0.85
handleWorkerMessageFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected