You will basically have to come up with a code to test the frequency of the processor, which is basically a while loop that counts the clocks within a time frame. To find the frequency of older processors such as the 80386 which does not have the RDTSC instruction, will be a bit more trivial. In all cases you will need to indentify the family of the processor with CPUID instruction to make results more accurate. So get creative because there is no instruction that will give you this frequency.
If your target CPU is using Intel SpeedStep technology or some kind of PST, ODCM technology then the speed will be varying over time and although you can access the adjusted speed too, the best and easiest way is to use the difference of RDTSC opcode's return value for a fixed amount of time.