Setup: I have a Google sheet where I would like to run a custom function implemented using a script. This script is used to perform a relatively lengthy URL lookup and decode process (10 ms per call, dependent on bandwidth and ping). The custom function uses one column as input, and returns the result.
Problem: When my Google sheet is opened, the column that uses this calculation is refreshed. This grinds the Google sheet to a halt for about 10 seconds, until each cell in the column is recalculated. This will only become worse as I add to my spreadsheet.
Question: Can I change my function script, or change a setting in Google sheets so that the slow custom function is only calculated when the input cell is changed?
For anyone curious, here is a demo sheet with my problem
Utilities.sleep(100);
. If I may ask, what benefit do you see in a sleep command in a custom function. It's one thing to stop/interrupt a script for a period of time, but why interrupt a custom function? – Tedinoz