There are two different methods for measuring hashing speed. The first one, used by NiceHash Miner, is measuring the number of iterations that show you the actual speed. Measuring iterations can be done only inside the software and cannot be done remotely.
The second measuring method is a statistical calculation according to the number, frequency, and difficulty of the submitted shares. This is the effective speed shown online. Because this method is statistical and because it has a measuring window of 5 minutes, it can never be as accurate as the local measuring of iterations. But, due to statistical distribution, your average speed online over longer periods of time (several hours, days) should be within +/-2% of your actual speed, as shown in NiceHash Miner.
Do note that you are paid according to your effective speed and not according to your actual speed because we reward miners for every accepted share.