title: Why are server-sent events fired every 3 seconds?
body: <p>I am new to server-sent events, so I am trying <a href="https://www.w3schools.com/html/html5_serversentevents.asp" rel="nofollow noreferrer">this W3Schools example</a> on WAMP Server. The files I have are:</p>
  <p><strong>demo_sse.php</strong></p>
  <pre><code>&lt;?php
    header('Content-Type: text/event-stream');
    header('Cache-Control: no-cache');
  
    $time = date('r');
    echo &quot;data: The server time is: {$time}\n\n&quot;;
    flush();
  ?&gt;
  </code></pre>
  <p><strong>index.php</strong></p>
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
    &lt;body&gt;
      &lt;h1&gt;Getting server updates&lt;/h1&gt;
      &lt;div id=&quot;result&quot;&gt;&lt;/div&gt;
      &lt;script&gt;
        if(typeof(EventSource) !== &quot;undefined&quot;) {
          var source = new EventSource(&quot;demo_sse.php&quot;);
          source.onmessage = function(event) {
            document.getElementById(&quot;result&quot;).innerHTML += event.data + &quot;&lt;br&gt;&quot;;
          };
        } else {
          document.getElementById(&quot;result&quot;).innerHTML = &quot;Sorry, your browser does not support server-sent events...&quot;;
        }
      &lt;/script&gt;
    &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  <p>As far as I understand, time is constantly changing, so the updates must be sent every second (at least). However, the updates are received every three seconds. This interval was not specified in demo_sse.php, so:</p>
  <ul>
  <li>Why does it send the updates every 3 seconds?</li>
  <li>How do I change this interval?</li>
  </ul>