Granular Timing Debugging in Actions
Feb 20, 2026
Overview
Solution
exports.onExecutePostLogin = async (event, api) => {
// Begin Timer at start of Action
const startT = performance.now();
// Record Action name in log
console.log("*** START [ACTION_NAME] - onExecutePostLogin ***");
// Perform external API CALL #1
// Calculate and print time taken after API Call above
const partialT1 = performance.now();
var totalT = partialT1 - startT;
console.log(performance.now());
console.log("*** Time taken for API CALL #1: ",totalT)
// Perform additional tasks #2
// Calculate and print time taken for above tasks #2
const partialT2 = performance.now();
var totalT = partialT2 - partialT1;
console.log("*** Time taken for tasks #2: ",totalT)
// Calculate and print time taken for whole Action
var totalT = performance.now() - startT;
console.log("*** Time taken for Action: ",totalT)
console.log("*** END [ACTION_NAME] - onExecutePostLogin ***");
}