src/Uno.Diagnostics.Eventing/Performance/Performance.cs
/// <summary>
/// Measures the time spent in the specified action.
/// </summary>
/// <param name="name">The logical name of the action</param>
/// <param name="action">The action to measure</param>
Measures the time spent in the specified action.
Measures the time spent in the specified action .
public static void Measure(string name, Action action)
		{
			if (Service != null && Service.IsEnabled)
			{
				Service.Measure(name, action);
			}
			else
            {
                if (_trace.IsEnabled)
                {
                    using (_trace.WriteEventActivity(
                        TraceProvider.Performance_MeasureStart,
                        TraceProvider.Performance_MeasureStop,
                        new[] { name }
                    ))
                    {
                        action();
                    }
                }
                else
                {
                    action();
                }
			}
		}
public static void Measure ( string name , Action action ) { if ( Service != null && Service . IsEnabled ) { Service . Measure ( name , action ) ; } else { if ( _trace . IsEnabled ) { using ( _trace . WriteEventActivity ( TraceProvider . Performance_MeasureStart , TraceProvider . Performance_MeasureStop , new [ ] { name } ) ) { action ( ) ; } } else { action ( ) ; } } }
Measures the time spent in the specified action.
Measures the time spent in the specified action .
name
string
The logical name of the action
The logical name of the action
action
Action
The action to measure
The action to measure