Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static void LinearMaxTime()
- {
- double ElapsedSeconds;
- long ElapsedTime = 0, MinTime = long.MaxValue, MaxTime = long.MinValue, IterationElapsedTime;
- for (int n = 0; n < (NIter + 1 + 1); ++n)
- {
- long StartingTime = Stopwatch.GetTimestamp();
- bool Present = IsPresent_LinearTime(TestVector, TestVector.Length - 1);
- long EndingTime = Stopwatch.GetTimestamp();
- IterationElapsedTime = EndingTime - StartingTime;
- ElapsedTime += IterationElapsedTime;
- if (IterationElapsedTime < MinTime) MinTime = IterationElapsedTime;
- if (IterationElapsedTime > MaxTime) MaxTime = IterationElapsedTime;
- }
- ElapsedTime -= (MinTime + MaxTime);
- ElapsedSeconds = ElapsedTime * (1.0 / (NIter * Stopwatch.Frequency));
- Console.Write("\t" + ElapsedSeconds.ToString("F4"));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement