Google Apps Script Service Using Too Much Computer Time for One Day

后端 未结 2 736
再見小時候
再見小時候 2020-12-18 16:32

So I got the error message in the subject on the 1 (one) script I had running yesterday and I am assuming I will get a similar message today.

I have improved the scri

2条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-18 16:53

    Every call to a service (Spreadsheet, Calendar or whatever) takes more time than regular JavaScript operations. For example, if you have to modify 10 cells in a Spreadsheet, calling range.setValue() 10 times takes far more time than having all the data in an array and then updating the spreadsheet in one go using range.setValues().

    If you can paste pieces of your code, the community will be able to offer more advice on how to improve your script.

提交回复
热议问题