public void GetOverlapping_PerformanceTest() { const int itemCount = 100000; const int requestCount = 10000; var random = new Random(42); var collection = new IntervalCollection <int>(); { int start; int end; for (var i = 0; i < itemCount; i++) { start = random.Next(1000); end = start + random.Next(1, 50); collection.Add(new TestInterval(start, end)); } } var stopwatch = Stopwatch.StartNew(); var selectedCount = 0; for (var i = 0; i < requestCount; i++) { var start = random.Next(1000); var end = start + random.Next(50); var result = collection.GetOverlapping(start, end); selectedCount += result.Count; } stopwatch.Stop(); Assert.Inconclusive($"Executed {nameof(collection.GetOverlapping)}() {requestCount} times to select {selectedCount} results from {itemCount} items in {stopwatch.Elapsed}"); }