src/Uno.Diagnostics.Eventing/Performance/Performance.cs
/// <summary>
/// Measures the time spent in the specified action.
/// </summary>
/// <param name="name">A func that provides 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(Func<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 ( Func < 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
Func<string>
A func that provides logical name of the action
A func that provides logical name of the action
action
Action
The action to measure
The action to measure