public void BechmarkClassFloat() { for (int i = 0; i < SIZE - 1; i++) { PointClassFloat.PointDistance(pointClassFloatArray[i], pointClassFloatArray[i + 1]); } }
public static float PointDistance(PointClassFloat pointOne, PointClassFloat pointTwo) { float x = pointOne.X - pointTwo.X; float y = pointOne.Y - pointTwo.Y; return(MathF.Sqrt((x * x) + (y * y))); }
public BenchmarkClass() { Random rnd = new Random(); for (int i = 0; i < SIZE; i++) { int x = rnd.Next(1, 100); int y = rnd.Next(1, 100); pointClassFloatArray[i] = new PointClassFloat(x, y); pointStructFloatArray[i] = new PointStructFloat(x, y); pointStructDoubleArray[i] = new PointStructDouble(x, y); } }