public void BechmarkStructShortFloat() { for (int i = 0; i < SIZE - 1; i++) { PointStructFloat.PointDistanceShort(pointStructFloatArray[i], pointStructFloatArray[i + 1]); } }
public static float PointDistanceShort(PointStructFloat pointOne, PointStructFloat pointTwo) { float x = pointOne.X - pointTwo.X; float y = pointOne.Y - pointTwo.Y; return((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); } }