If you are working with Google Apps Script, one of your priorities is definitely going to be a simple timer. Everything takes longer than you are used to, and you have to be very careful what you ask for.
Here’s a simple timer for Google Apps script (actually javaScript generally).
You use it like this
// cache read: steps through all cells in a sheet useTimer('a').start('read cached inputdata sheet values using foreach'); cache.forEach( function(v,r,c) { x = v; } ); useTimer('a').stop(); // cache write: copies the values to somewhere else on the same sheet useTimer('b').start('make a copy on same sheet'); for (var i = 0; i < nr ; i++) for (var j = 0; j < nc; j++) { cache.setValue(cache.getValue(i+1,j+1),i+1,j+1+nc); } cache.commit(); useTimer('b').stop(); // cache write: copies the font Colors to somewhere else on the same sheet useTimer('c').start('make a copy on same sheet of font Colors'); for (var i = 0; i < nr ; i++) for (var j = 0; j < nc; j++) { cacheFontColors.setValue(cacheFontColors.getValue(i+1,j+1),i+1,j+1+nc); } cacheFontColors.commit(); useTimer('c').stop(); ///.......etc...etc... // report all timers DebugPrint(useTimer().report());
and you get this
|
For more infomation and to get the code for this and other stuff see, Google Apps Script Timer collection.