This sample script is for measuring the execution time of built-in functions for Google Spreadsheet. Unfortunately, there are not measurement tools for retrieving the execution time of built-in functions. So I thought of about a workaround.
- Import a value to a cell. The value is anything good, because this is used as a trigger. Please do this by yourself.
- Custom functions cannot use
setValue()
. So I usedonEdit()
.
- Custom functions cannot use
func1()
imports a formula that you want to measure the execution time by the script launched by the trigger.- At
func2()
, after set the formula, the measurement is started. The confirmation when built-in function was completed is carried out using loop.- By measuring the cost per one call for
getValue()
, it was found that that was about 0.0003 s. So I thought that this can be used.
- By measuring the cost per one call for
- The result of measurement can be seen at Stack