A React Native app for the ultimate thinking partner.
1// Quick performance test for text input
2// Run this in your browser console while typing
3
4let lastTime = performance.now();
5let delays = [];
6
7// Patch the input to measure actual delay
8const measureInputDelay = () => {
9 const input = document.querySelector('input, textarea');
10 if (!input) {
11 console.log('No input found');
12 return;
13 }
14
15 input.addEventListener('input', (e) => {
16 const now = performance.now();
17 const delay = now - lastTime;
18 delays.push(delay);
19
20 if (delays.length > 50) delays.shift();
21
22 const avg = delays.reduce((a, b) => a + b, 0) / delays.length;
23 const max = Math.max(...delays);
24
25 console.log(`Input delay: ${delay.toFixed(1)}ms | Avg: ${avg.toFixed(1)}ms | Max: ${max.toFixed(1)}ms`);
26 lastTime = now;
27 });
28
29 console.log('Performance monitoring enabled. Start typing...');
30};
31
32measureInputDelay();