Are there methods to measure the execution time when built-in functions completed for Spreadsheet? When I use several built-in functions (For example, IMPORTHTML and IMPORTXML), if I know the average execution-time, it is easy for me to use and design data sheet.
I measure it of custom functions using this script.
function myFunction() {
var start = new Date();
// do something
var end = new Date();
var executiontime = end - start;
}
Thank you so much for your time and advices.
Google Sheets doesn't include a built-in tool to measure the recalculation time.
One alternative is to use the Chrome Developers Tools Timeline but bear in mind that functions like IMPORTHTML and IMPORTXML are not recalculated every time that the spreadsheet does (reference Set a spreadsheet’s location and calculation settings).
Related Q&A
SO
Web Applications
Unfortunately, there are not measurement tools for retrieving the execution time of built-in functions. This has already been commented by @Rubén. So I thought of about the workarounds. How about the following workaround?
Flow :
setValue()
. So I usedonEdit()
.func1()
imports a formula that you want to measure the execution time by the script launched by the trigger.func2()
, after set the formula, the measurement is started. The confirmation when built-in function was completed is carried out using loop.getValue()
, it was found that that was about 0.0003 s. So I thought that this can be used.Sample script :
Note :
getValue()
.If this was useful for you, I'm glad.