title: Delay on calculation OnChange event
body: <p>I'm trying to calculate the difference between two numbers in DECIMALS. The problem is that it takes around 2-3 sencods, this is a problem since the inputs are time, and the user can fire the event really quick and it seems to crash somehow.
  Could this be coming from not round the decimals? I just need 2 digits after coma.</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html lang="en"&gt;
  &lt;head&gt;
  &lt;meta charset="UTF-8"&gt;
  &lt;title&gt;Testing&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  
  &lt;input type="date" name="" id=""&gt;
  &lt;input type="time" step="300" name="" id="startTime" onkeydown="return false" /&gt;
  &lt;input type="time" step="300" name="" id="endTime" onkeydown="return false" /&gt;
  &lt;input type="text" id="totalHours"&gt;
  &lt;/body&gt;
  
  
  &lt;script&gt;
  
  document.querySelector("#startTime").onchange = function (e) {
  }
  
  document.querySelector("#endTime").onchange = function (e) {
      timeDiff();
  }
  
  function timeDiff() {
      var start = document.querySelector("#startTime").value;
      var end = document.querySelector("#endTime").value;
  
  
      var startSplit = start.split(":");
      var startHsToMinutes = startSplit[0] * 60;
      var startTotalMinutes = parseInt(startSplit[1]) + startHsToMinutes;
  
      var endSplit = end.split(":");
      var endHsToMinutes = (endSplit[0] * 60);
      var endTotalMinutes = parseInt(endSplit[1]) + endHsToMinutes;
  
      var totalHours = endTotalMinutes - startTotalMinutes;
      document.querySelector("#totalHours").value = totalHours / 60;
  
  }
  &lt;/script&gt;
  &lt;/html&gt;
  </code></pre>