public void BechmarkStructDouble() { for (int i = 0; i < SIZE - 1; i++) { PointStructDouble.PointDistance(pointStructDoubleArray[i], pointStructDoubleArray[i + 1]); } }
public static double PointDistance(PointStructDouble pointOne, PointStructDouble pointTwo) { double x = pointOne.X - pointTwo.X; double y = pointOne.Y - pointTwo.Y; return(Math.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); } }