Window.performance in nuqs source code.

In this article, we will review window.performance in nuqs source code. We will look at What is window.performance? Usage in nuqs codebase. What is window.performance? The performance interface provides access to performance related information for the current page. There are instance properties. Read more about instance properties. There are also instance methods available. Read more about instance methods. performance entries are specific to each execution context. You can access performance information for code running in a window via Window.performance, and for code running in a worker via WorkerGlobalScope.performance Usage in nuqs codebase. Performance is used in the following files shown in the screenshot below. At line 103 in update-queue.ts file, performance.now is used as shown below: lastFlushTimestamp = performance.now() At line no 8 in a file named debug.ts, in the nuqs package, you will find that performance is used shown below. performance.mark(msg) performance.mark You might be wondering what performance.mark is. performance.mark creates a timestamp in the browser’s performance entry buffer with the given name. Read more about performance.mark. performance.now Performance.now Returns a DOMHighResTimeStamp representing the number of milliseconds elapsed since a reference instant. Read more about performance.now. About me: Hey, my name is Ramu Narasinga. I study large open-source projects and create content about their codebase architecture and best practices, sharing it through articles, videos. Configure features such as Changesets, Supabase auth in your Next.js project using Think Throo CLI. Email — ramu@thinkthroo.com My Github —  https://github.com/ramu-narasinga My website —  https://ramunarasinga.com My YouTube channel —  https://www.youtube.com/@ramu-narasinga Learning platform —  https://thinkthroo.com Codebase Architecture —  https://app.thinkthroo.com/architecture Best practices —  https://app.thinkthroo.com/best-practices Production-grade projects —  https://app.thinkthroo.com/production-grade-projects References https://github.com/47ng/nuqs/blob/next/packages/nuqs/src/update-queue.ts#L103 https://developer.mozilla.org/en-US/docs/Web/API/Performance

May 30, 2025 - 05:10
 0
Window.performance in nuqs source code.

In this article, we will review window.performance in nuqs source code. We will look at

  1. What is window.performance?

  2. Usage in nuqs codebase.

What is window.performance?

The performance interface provides access to performance related information for the current page.

There are instance properties. Read more about instance properties.

There are also instance methods available. Read more about instance methods.

performance entries are specific to each execution context. You can access performance information for code running in a window via Window.performance, and for code running in a worker via WorkerGlobalScope.performance

Usage in nuqs codebase.

Performance is used in the following files shown in the screenshot below.

At line 103 in update-queue.ts file, performance.now is used as shown below:

 lastFlushTimestamp = performance.now()

At line no 8 in a file named debug.ts, in the nuqs package, you will find that performance is used shown below.

  performance.mark(msg)

performance.mark

You might be wondering what performance.mark is. performance.mark creates a timestamp in the browser’s performance entry buffer with the given name. Read more about performance.mark.

performance.now

Performance.now Returns a DOMHighResTimeStamp representing the number of milliseconds elapsed since a reference instant. Read more about performance.now.

About me:

Hey, my name is Ramu Narasinga. I study large open-source projects and create content about their codebase architecture and best practices, sharing it through articles, videos.

Configure features such as Changesets, Supabase auth in your Next.js project using Think Throo CLI.

Email — ramu@thinkthroo.com

My Github —  https://github.com/ramu-narasinga

My website —  https://ramunarasinga.com

My YouTube channel —  https://www.youtube.com/@ramu-narasinga

Learning platform —  https://thinkthroo.com

Codebase Architecture —  https://app.thinkthroo.com/architecture

Best practices —  https://app.thinkthroo.com/best-practices

Production-grade projects —  https://app.thinkthroo.com/production-grade-projects

References

  1. https://github.com/47ng/nuqs/blob/next/packages/nuqs/src/update-queue.ts#L103

  2. https://developer.mozilla.org/en-US/docs/Web/API/Performance