Trying To Write Code That Won't Do Anything Until It Is A Certain Time Of Day, But I Get Error Message "exceeded Maximum Stack Depth"
This is my code: I am trying to write code that will only continue once it hits a certain time, I'm sure there's a way easier way to do this, but I'm brand new. Thanks.
Solution 1:
There's a limit on how deep you can recurse, and in you case, that's A LOT of calls in a short period.
When you call a function it gets added to the stack in memory, and there's a limit on how big the stack can be. You can read more here about how it works.
You could use sleep and call that function only every second or so, or at least half a second or something.
Solution 2:
It seems like using a time driving trigger is what would work best. Have you looked into triggers? https://developers.google.com/apps-script/guides/triggers/installable
Post a Comment for "Trying To Write Code That Won't Do Anything Until It Is A Certain Time Of Day, But I Get Error Message "exceeded Maximum Stack Depth""