public void MarkEntriesTest() { _block.Begin(); Thread.Sleep(1); _block.Mark(Mark1); Thread.Sleep(1); _block.Mark(Mark2); _block.End(); Assert.True(_block.LastMilliseconds >= 2); Assert.Equal(2, _block.Entries.Count); var item1 = _block.Entries[0]; Assert.Equal(Mark1, item1.Label); Assert.True(item1.Milliseconds >= 1); var item2 = _block.Entries[1]; Assert.Equal(Mark2, item2.Label); Assert.True(item2.Milliseconds >= 2); }
/// <summary> /// Mark this timing. /// </summary> /// <param name="label"></param> public void Mark(string label = null) { label = label ?? string.Empty; _block.Mark(label); }