Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding PerformanceObserver for long task and animation frame #6251

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

arafatkatze
Copy link
Collaborator

@arafatkatze arafatkatze commented Dec 4, 2024

This PR is a part of the linear issue and @dominiccooney recommend this here

Test plan

Add the following right below the current additions

   setTimeout(() => {
            const start = performance.now();
            while (performance.now() - start < 100) {
                // Simulate a long task by blocking the main thread for 100ms
            }
            console.log('Fake long task executed');
        }, 1000);

        // Fake long animation frame
        requestAnimationFrame(() => {
            const start = performance.now();
            while (performance.now() - start < 100) {
                // Simulate a long animation frame by blocking the main thread for 100ms
            }
            console.log('Fake long animation frame executed');
        });

Run the code in debugger and in the console log you will see
image

Changelog

Copy link

github-actions bot commented Dec 4, 2024

‼️ Hey @sourcegraph/cody-security, please review this PR carefully as it introduces the usage of an unsafe_ function or abuses PromptString.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant