Virtual sdcard printing, how to get elasped print time

in virtual sdcard printing,
I’m using M23 to select file, then M24 to start print
when it finished printing, how to output the elapsed time, it only output “Done printing file” in the console