title: Google sheets script, timed out just after 30ish something seconds
body: <p>I created a scrpit to turns time copied from Excel to proper format.<br>
  Because 12.30, 09.34, 07.40, or 08.00 would end up as 12.3, 9.34, 7.4, and 8 when I pasted them into google sheets. 
  Some tables event contain time format like 1230, 934, or 740 so I have to fix that too. 
  Here is my code.</p>
  
  <pre><code>function onEdit(event) {
    if (event.range.getColumn() == 3 ) {
      for(var i = 1; i&lt;= range.getNumRows() ; i++){
        var r = range.getCell(i, 1);
        var rvalue = r.getValue();
        var rvalues = rvalue.toString();
        var rvalength = rvalues.length;
        if (rvalue != ""){
          if (rvalength == 3) {
            if (parseInt(rvalues.substring(0,2))&gt;24) {
              r.setValue(rvalues.substring(0,1)+"."+rvalues.substring(1,3));
            }
            else
            {
              r.setValue(rvalues.substring(0,2)+"."+rvalues.substring(2,3));
            }
          }
          else if ( rvalength == 4 ) {
            r.setValue(rvalues.substring(0,2)+"."+rvalues.substring(2,4));
          }
          else if ( rvalength == 2 ) {
            r.setValue("."+rvalues);
          }
          r.setNumberFormat("00.00");
        }
      }
    }
  }
  </code></pre>
  
  <p>It works fine when it's a small table, but when it's getting big like it's 200x500 table, the code just stopped. 
  Execution log said the status is "Timed Out" and the duration is always 30-33 seconds.<br>
  I heard that Google App Scripts has 6 minutes timeout so I have no idea why my code always Timed Out at about 30ish something seconds. </p>
  
  <p>I don't think the reason is because of my code but I think it can also be optimized for better performance, I just don't know how.</p>