public void TestWithMarkers()
{
Profiler.Reset();
const int timeToWait = 10;
var watcher = ExpectLog(new List <MatchMessageDelegate>()
{
MessageStartWith("[Profiler] #0: Begin: TestProfiler.Test"),
MessageStartWith("[Profiler] #0: Mark: TestProfiler.Test", timeToWait),
MessageStartWith("[Profiler] #0: Mark: TestProfiler.Test", timeToWait * 2),
MessageStartWith("[Profiler] #0: End: TestProfiler.Test", timeToWait * 2),
});
{
Profiler.EnableAll();
using (var profile = Profiler.Begin(TestKey))
{
Utilities.Sleep(timeToWait);
profile.Mark();
Utilities.Sleep(timeToWait);
profile.Mark();
}
}
watcher.Finish();
}