UGA Boxxx

つぶやきの延長のつもりで、知ったこと思ったこと書いてます

【GAS】setTimeoutは使えないのでUtilities.sleepを使う

Google Apps ScriptでsetTimeoutをやりたかったが、できなかったので調べた

developers.google.com

以下の処理で遅延させることができる

Utilities.sleep(1000);

sleep(milliseconds) Sleeps for specified number of milliseconds. Immediately puts the script to sleep for the specified number of milliseconds. The maximum allowed value is 300000 (or 5 minutes).

最大5分間遅延させることができる