NVMe has log pages and the only thing close to what you want is found in log page 02h, it has the following pieces of info:
- Data Units Read
- Data Units Written
- Host Read Commands
- Host Write Commands
- Controller Busy Time
So you can take the number of host read and write commands and divide them with the controller busy time, if you do this in relatively short intervals and substract the current value from the previous value you will get the average time of a command in that time interval. Not pretty but close enough.
If you are on Linux you can use the nvme-cli command to get this data.
The above is all internal latency, if you want end-to-end latency you have to measure it yourself in your own application. You have a similar mechanism in /proc/diskstats in Linux that shows number of commands and "busy time" of them to average.