How to measure frame rendering time?

How can I accurately measure the time it takes to render a frame?

Currently I am trying to measure it in my animation loop like so:
let startTime =
renderer.render(scene, camera)
let endTime =
let time = endTime-startTime

but this is giving me really small values (e.g. 1 ms) which makes me suspect that the call to renderer.render() is somehow returning instantly.

Is this a good way to measure the rendering time of a frame?

Yes it should be really small, overall the animation frame should ideally take not much more than16 ms to get 60 FPS, for inspection purposes dev tools shows you the timings of each frame. Otherwise you can do it as you do, which is also how THREE.Clock works.

use the gui stat to measure rendering frame rate

Do you mean the default fps value in the Stats gui?