I am trying to create stopwatch functionality in google spreadsheet using google apps script. I have a cell which displays the counter and should be incremented after every millisecond when I press the start button.and it should stop whenever I press the stop button.
Currently my problem is that my spreadsheet is not updated after every second/millisecond during the script execution, the cell in the spreadsheet only updates after the script has finished executing.
can any one help or is this feature not possible?
var ss= SpreadsheetApp.getActiveSpreadsheet();
var ss1=ss.getSheetByName("stopwatch");
function timerstart() {
for(i=0;i<10000;i++){
Utilities.sleep(10);
ss.getRange('B6').setValue(i);
}
}