Executes the given async function and measures how long the execution takes.