Solution 1 :
For measuring frame rate in ARCore 1.19 you can use
getTimestamp() public method of a public class
Frame. At 60 fps, every frame lasts approximately 16.67 ms (or ~16670000 ns).
public long getTimestamp()
Let’s see what official documentation says:
getTimestamp()method returns the timestamp in nanoseconds when this image was captured. This can be used to detect dropped frames or measure the camera frame rate. The time base of this value is specifically not defined, but it is likely similar to
So, if a time difference between each current and previous frame is ~16670000 nanosec, frame rate is 60 fps. But if a time difference is ~33330000 nanosec, then frame rate is 30 fps.
I am using the HelloAR sample application. The sample uses ARCore. I am running the sample on an Android Samsung Galaxy Tab S5e.
How can I measure the framerate (Frames Per Second) of my AR app? I need to graph the data, so ideally the output of whatever approach I take will give me some sort of CSV e.g. time,fps
I’ve tried looking at GameBench, but that requires me to fill out a form and wait for a “specialist” to get back to me… I have also tried dumpsys with framestats, but that only outputs 2 frames and very seldom updates. I have also tried some projects from GitHub (TinyDancer), but that does not work.
Comment posted by Xarus
GameBench employee here – shoot me an email at jake [at] gamebench.net
Comment posted by pookie
Hmm, but this will measure the frame rate of the camera. I want to measure the frame rate of the application – how fast images are rendered/updated on the screen. The camera might capture at 60fps, but if there is some heavy processing, images will not be presented at 60fps, correct?
Comment posted by Andy Jazz
Test it, please. If a whole app delays (due to heavy processing), camera’s frames delay too…