public void Contains() { m_Mask.Set(2); m_Mask.Set(3); BitMask128 otherMask = new BitMask128(); otherMask.Set(3); Assert.IsTrue(m_Mask.Contains(otherMask)); otherMask.Set(4); Assert.IsFalse(m_Mask.Contains(otherMask)); }
public void PerformaceContains() { const int passes = 100000000; Stopwatch watch = new Stopwatch(); BitMask128 maskA = new BitMask128(); BitMask128 maskB = new BitMask128(); watch.Restart(); for (int x = 0; x < passes; ++x) { maskA.Contains(maskB); } TestContext.WriteLine($"128bitmask, {passes} passes, time elapsed: {watch.ElapsedMilliseconds}ms"); }