feat: add cursor settings, enhance setup wizard and loading animations
This commit is contained in:
1 parent
ba211641a6
commit
50f6812054
10 files changed
+374
-130
No files matched your search
@@ -0,0 +1,20 @@
|
||||
export function estimateRefreshRate(): Promise<number> {
|
||||
return new Promise((resolve) => {
|
||||
let last = performance.now();
|
||||
let frames = 0;
|
||||
|
||||
function loop() {
|
||||
const now = performance.now();
|
||||
frames++;
|
||||
|
||||
if (now - last >= 1000) {
|
||||
console.log(`Estimated Refresh Rate: ${frames} FPS`);
|
||||
resolve(frames); // estimated Hz
|
||||
} else {
|
||||
requestAnimationFrame(loop);
|
||||
}
|
||||
}
|
||||
|
||||
requestAnimationFrame(loop);
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user