# HG changeset patch # User moel.mich # Date 1272206419 0 # Node ID 1a2d7dad320e4f7584f5f3120a8a68dad21cb329 # Parent 364ca73ba4630c9ac2715d5b99cc640900bd9078 Fixed Issue 43. diff -r 364ca73ba463 -r 1a2d7dad320e Hardware/CPU/IntelCPU.cs --- a/Hardware/CPU/IntelCPU.cs Sun Apr 25 13:16:28 2010 +0000 +++ b/Hardware/CPU/IntelCPU.cs Sun Apr 25 14:40:19 2010 +0000 @@ -211,7 +211,11 @@ EstimateMaxClock(0); // estimate the max clock in MHz - estimatedMaxClock = 1e-6 * EstimateMaxClock(0.01); + List estimatedMaxClocks = new List(3); + for (int i = 0; i < 3; i++) + estimatedMaxClocks.Add(1e-6 * EstimateMaxClock(0.025)); + estimatedMaxClocks.Sort(); + estimatedMaxClock = estimatedMaxClocks[1]; lastTimeStampCount = 0; lastTime = 0; @@ -289,7 +293,8 @@ uint lsbBegin, msbBegin, lsbEnd, msbEnd; Thread.BeginThreadAffinity(); - long timeBegin = Stopwatch.GetTimestamp() + 2; + long timeBegin = Stopwatch.GetTimestamp() + + (long)Math.Ceiling(0.001 * ticks); long timeEnd = timeBegin + ticks; while (Stopwatch.GetTimestamp() < timeBegin) { } WinRing0.Rdtsc(out lsbBegin, out msbBegin);