hi!
I think you can do this to get how much time it took for the current render to get to the afterRender step
function afterRender (req, res) {
const executionTimeMs = new Date().getTime() - req.context.startTimestamp
}
just have in mind that the req.context.startTimestamp represents the start time of the current template, so if somehow the script is attached to a child template it will only give you how much time it tooks that specific child render, as long as you attach this script to your main template you will be able to get the time you expect.