title: A changing rate clock in jquery
body: <p>novice here, working through a project i'm trying to build for a piece of educational multimedia in science.</p>
  
  <p>I has a scenario where students are asked to record the temperature on a scale very minute for ten minutes.</p>
  
  <p>i don't want them to waste ten minutes watching so i wish to display a clock on screen that will go slow for the first 5 seconds of every minute, speed up for 50 seconds then a normal rate again for the last 5 seconds..... </p>
  
  <p>What I have achieved with very basic code is as follows</p>
  
  <pre><code>&lt;div class="timer"&gt;
  &lt;span class="minute"&gt;00&lt;/span&gt;:&lt;span class="second"&gt;00&lt;/span&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>and the script</p>
  
  <pre><code>function gotimer()
  {
  var time = 0;
  var timer_id;   
  var rate = 1000;
  
  function check(){
      if ( secondcount &lt;= 5) {
      console.log("under")
      rate = 1000;
      console.log("rate" + rate)
      }
      else if ( secondcount &gt;= 6 &amp;&amp;  secondcount &lt;= 54 ) {
      console.log("between")
      rate = 300;
      console.log("rate" + rate)
      }
      else if ( secondcount &gt;= 55 ) {
      console.log("between")
      rate = 1000;
      console.log("rate" + rate)
      }
  }
  
  
  timer_id = setInterval(function()
          {
  
              //console.log($('.second').text())
              secondcount = parseInt($('.second').text()); 
              console.log(secondcount)
              time++;
              generateTime();
              check();
  
          }, rate);
  
  this.getTime = function()
  {
      return time;
  }
  
  function generateTime()
  {
      var second = time % 60;
      var minute = Math.floor(time / 60) % 60;
  
      second = (second &lt; 10) ? '0'+second : second;
      minute = (minute &lt; 10) ? '0'+minute : minute;
  
      $('div.timer span.second').html(second);
      $('div.timer span.minute').html(minute);
      }
  }
  
  var timer;
  
  $(document).ready(function(e) 
  {
  timer = new gotimer
  });
  </code></pre>
  
  <p>I have worked at it a few days and I get a changing console log but no change in rate. I know my coding is far from good any any suggestions would be greatly appreciated.</p>