I don't like the name measure here. This function doesn't measure, it just runs the callback n times with a delay between each run (as the comment clearly explains. Could we find another name? It's confusing on call sites, we expect this function to do some measurements when it's still up to the caller to do that.