private void TestUShort() { Debug.Log(" Testing ObscuredUShort vs ushort preformance:\n " + ushortIterations + " iterations for read and same for write"); Stopwatch sw = Stopwatch.StartNew(); ObscuredUShort obscured = 100; ushort notObscured = obscured; ushort dummy = 0; for (int i = 0; i < ushortIterations; i++) { dummy = obscured; } for (int i = 0; i < ushortIterations; i++) { obscured = dummy; } Debug.Log(" ObscuredUShort:\n " + sw.ElapsedMilliseconds + " ms "); sw.Reset(); sw.Start(); for (int i = 0; i < ushortIterations; i++) { dummy = notObscured; } for (int i = 0; i < ushortIterations; i++) { notObscured = dummy; } sw.Stop(); Debug.Log(" ushort:\n " + sw.ElapsedMilliseconds + " ms "); if (dummy != 0) { } if (obscured != 0) { } if (notObscured != 0) { } }
private void TestUShort() { logBuilder.AppendLine("ObscuredUShort vs ushort, " + ushortIterations + " iterations for read and write"); ObscuredUShort obscured = 100; ushort notObscured = obscured; ushort dummy = 0; var sw = Stopwatch.StartNew(); for (var i = 0; i < ushortIterations; i++) { dummy = obscured; } for (var i = 0; i < ushortIterations; i++) { obscured = dummy; } sw.Stop(); logBuilder.AppendLine("ObscuredUShort:").AppendLine(sw.ElapsedMilliseconds + " ms"); sw.Reset(); sw.Start(); for (var i = 0; i < ushortIterations; i++) { dummy = notObscured; } for (var i = 0; i < ushortIterations; i++) { notObscured = dummy; } sw.Stop(); logBuilder.AppendLine("ushort:").AppendLine(sw.ElapsedMilliseconds + " ms"); if (dummy != 0) { } if (obscured != 0) { } if (notObscured != 0) { } }
private void TestUShort() { this.logBuilder.AppendLine("ObscuredUShort vs ushort, " + this.ushortIterations + " iterations for read and write"); ObscuredUShort value = 100; ushort num = value; ushort num2 = 0; Stopwatch stopwatch = Stopwatch.StartNew(); for (int i = 0; i < this.ushortIterations; i++) { num2 = value; } for (int j = 0; j < this.ushortIterations; j++) { value = num2; } stopwatch.Stop(); this.logBuilder.AppendLine("ObscuredUShort:").AppendLine(stopwatch.ElapsedMilliseconds + " ms"); stopwatch.Reset(); stopwatch.Start(); for (int k = 0; k < this.ushortIterations; k++) { num2 = num; } for (int l = 0; l < this.ushortIterations; l++) { num = num2; } stopwatch.Stop(); this.logBuilder.AppendLine("ushort:").AppendLine(stopwatch.ElapsedMilliseconds + " ms"); if (num2 != 0) { } if (value != 0) { } if (num != 0) { } }
private void TestUShort() { UnityEngine.Debug.Log(" Testing ObscuredUShort vs ushort preformance:\n " + ushortIterations + " iterations for read and same for write"); Stopwatch stopwatch = Stopwatch.StartNew(); ObscuredUShort value = (ushort)100; ushort num = value; ushort num2 = 0; for (int i = 0; i < ushortIterations; i++) { num2 = value; } for (int j = 0; j < ushortIterations; j++) { value = num2; } UnityEngine.Debug.Log(" ObscuredUShort:\n " + stopwatch.ElapsedMilliseconds + " ms "); stopwatch.Reset(); stopwatch.Start(); for (int k = 0; k < ushortIterations; k++) { num2 = num; } for (int l = 0; l < ushortIterations; l++) { num = num2; } stopwatch.Stop(); UnityEngine.Debug.Log(" ushort:\n " + stopwatch.ElapsedMilliseconds + " ms "); if (num2 != 0) { } if ((ushort)value != 0) { } if (num == 0) { } }