When using EventSource, should I log two events, or compute the duration and log only one?
问题 Assume I have some method that I want to trace performance information for. Using System.Diagnostics.Tracing.EventSource , I can see two logical ways of doing this; first, one could write two events, one at the start, and one at the end, and then the consumer of the events could compute the duration: MySource.Log.OperationStart(); RunMyOperation(); MySource.Log.OperatingFinish(); Or, I can compute the duration myself, and only write a single event: var sw = System.Diagnostics.Stopwatch