<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Refreshrate</title>
    <description>The latest articles on DEV Community by Refreshrate (@refreshrate).</description>
    <link>https://dev.to/refreshrate</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4249482%2Fe29241e4-6ac2-40bd-841f-9f0c3a3be1bf.png</url>
      <title>DEV Community: Refreshrate</title>
      <link>https://dev.to/refreshrate</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/refreshrate"/>
    <language>en</language>
    <item>
      <title>How I Built a Real-Time Display Refresh Rate Tester Using Astro.js &amp; requestAnimationFrame</title>
      <dc:creator>Refreshrate</dc:creator>
      <pubDate>Tue, 17 Nov 2026 10:05:24 +0000</pubDate>
      <link>https://dev.to/refreshrate/how-i-built-a-real-time-display-refresh-rate-tester-using-astrojs-requestanimationframe-5fb1</link>
      <guid>https://dev.to/refreshrate/how-i-built-a-real-time-display-refresh-rate-tester-using-astrojs-requestanimationframe-5fb1</guid>
      <description>&lt;p&gt;As developers, gamers, and tech enthusiasts, we often invest in high refresh rate monitors (120Hz, 144Hz, or even 240Hz). But here is a common problem: just because your operating system settings say 144Hz doesn't mean your browser is actually rendering at that speed.&lt;/p&gt;

&lt;p&gt;Sometimes, a faulty HDMI/DP cable, incorrect GPU settings, or browser hardware acceleration issues can silently cap your frame rate at 60Hz.&lt;/p&gt;

&lt;p&gt;I needed a quick, installation-free way to verify my actual screen refresh rate directly in the browser. Since I couldn't find a lightweight tool that was completely ad-free and minimal, I decided to build one myself.&lt;/p&gt;

&lt;p&gt;Here is introducing: &lt;a href="https://refreshrate.net/" rel="noopener noreferrer"&gt;Refresh Rate Tester&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Tech Stack
&lt;/h2&gt;

&lt;p&gt;I wanted the tool to be extremely fast and lightweight. Here is what I used:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Astro.js:&lt;/strong&gt; For building a highly optimized, static, and zero-JS-by-default foundation.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Tailwind CSS:&lt;/strong&gt; For clean, responsive styling that looks great on both desktop and mobile.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Vanilla JavaScript:&lt;/strong&gt; For the core logic.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  How It Works Under the Hood
&lt;/h2&gt;

&lt;p&gt;The core logic relies entirely on the browser's native requestAnimationFrame API.&lt;/p&gt;

&lt;p&gt;Instead of trying to read system-level hardware settings (which browsers can't easily do anyway for security reasons), the script calculates the time difference between consecutive screen repaints.&lt;/p&gt;

&lt;p&gt;Here is a simplified version of how the logic works:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="n"&gt;frameCount&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="n"&gt;lastTime&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;performance&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;now&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="n"&gt;currentHz&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;calculateRefreshRate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;performance&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;now&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="n"&gt;frameCount&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="c1"&gt;// Update the Hz every second (1000 milliseconds)&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;now&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;lastTime&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="mi"&gt;1000&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;currentHz&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;frameCount&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="nb"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sb"&gt;`Current Refresh Rate: ${currentHz} Hz`&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

        &lt;span class="c1"&gt;// Reset for the next second&lt;/span&gt;
        &lt;span class="n"&gt;frameCount&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="n"&gt;lastTime&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="c1"&gt;// Loop the function for the next frame paint&lt;/span&gt;
    &lt;span class="nf"&gt;requestAnimationFrame&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;calculateRefreshRate&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c1"&gt;// Start the loop&lt;/span&gt;
&lt;span class="nf"&gt;requestAnimationFrame&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;calculateRefreshRate&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;By counting how many frames the browser can paint in one single second, we get the exact screen refresh rate (Hz). Since all calculations run entirely on the client side in your browser, there is zero server latency involved, ensuring 100% accuracy.&lt;/p&gt;

&lt;h2&gt;
  
  
  🚀Try It Out
&lt;/h2&gt;

&lt;p&gt;You can test your own display's refresh rate instantly here:&lt;br&gt;
&lt;a href="https://refreshrate.net/" rel="noopener noreferrer"&gt;🔗 refreshrate.net&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;No app installation or plugins are required—it works directly in your browser on both mobile and desktop.&lt;/p&gt;

&lt;p&gt;I'd love to hear your feedback on the UI, the performance, or if you have any suggestions for new features (like adding motion blur tests or frame skipping tests in the future).&lt;/p&gt;

&lt;p&gt;Drop a comment below! Let me know what Hz your current screen is running at. 👇&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>astro</category>
      <category>showdev</category>
    </item>
  </channel>
</rss>
