replicating pulseIn on MatLAB

Long story short I have to replicate the pulseIn() command in MatLAB reading in an acceleration X and Y component. I was doing research and found that this link:

had a similar request but the "adiosrv.pde" file is outdated and the native command (tic, toc) for Matlab is not consistent enough to give me the accurate readings I need for this project. Apparently the .pde file has changed name and/or been split up into multiple documents and I cannot find it anywhere for the life of me. any input?