Tedmong:
Hello johnwasser,I tried to compile your given code using Arduino.ino, but memory issue popped up. I also carefully saw your found Github code, but laser and photodiode pin are not defined. Have you solved this problem?
As I noted, the code that the OP found did not translate well from Russian and had a problem with using way too much memory. You should probably start by finding a copy of Application Note AN034 (apparently now called Application Note AN000249) for the GP22 and working from there.
https://ams.com/documents/20143/36005/TDC-GP22_AN000249_1-00.pdf