There are several ways to do it. I dip a small quantity of the mash using a very small saucepan (which I swiped from Mrs) and then set that in a sink with a small amount of cold water and it cools pretty quickly but it does take some time. Things you use to adjust take some time to mix into the mash and some time to react so that a few cycles of measure, add, wait, measure again are going to put appreciable time on the clock and it is clear that mash pH will not be correct during that time. I guess you can argue that if mash pH is too low the enzymes are not working at their peak efficiency but that as long as you get pH into the right range they should come to peak efficiency and do the job on the substrate they were not attacking optimally at the outset. This reasoning bothers me a little. It certainly doesn't apply to temperature as an excessively high temperature could denature an enzyme irreparably.
Thus it is best that the mash pH measurement be a check of a pH you are confident will be close to what you want. The best way to be sure where pH is going is to do a test mash - a small portion of the grist in a proportionate amount of the water you are going to mash with in a glass in a water bath or in any arrangement which holds it at approximately the right temperature. Check the pH of that. If it is too low add some chalk or lime until, after a suitable wait, it is correct. If it is too high, add some more acid or sauemalz. Again, wait and measure. Now scale the amount of corrective substance to the full mash size and go ahead and dough in. You probably won't be spot on and that is OK. Next time add more or less sauermalz or chalk accordingly as to whether the full mash pH was too high or too low. Eventually you will zero in on the right additions and the mashtun check becomes no more than that - a check.
If, in the mash measurement, you wind up with a reading that is way off base then you should, of course, try to correct it in the mash tun. While this is not desirable it is, of course, better than ruining the beer.