Measure OS timer precision to refine calibration

Do not trust the OS at all and measure timer precision before
calibrating the delay loop and use that measurement to get reasonable
precision for our own delay code.

Print a measurement for a delay of 4x the OS timer resolution.

Be precise about how bad the deviation was if we had to recalculate.

Tested on Windows XP, 32 bit, built using MinGW by Uwe. Tested on
FreeDOS v1.0 Final, 32bit, built using DJGPP 4.3.2 by Idwer.

Corresponding to flashrom svn r1028.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
Acked-by: Idwer Vollering <vidwer+lists.flashrom@gmail.com>
1 file changed