2018-01-31 21:09:15 +03:00
|
|
|
|
using System.ComponentModel;
|
2016-03-22 23:02:25 +03:00
|
|
|
|
using System.Runtime.CompilerServices;
|
|
|
|
|
|
2017-03-07 22:56:24 +03:00
|
|
|
|
namespace Xamarin.Forms.Internals
|
2016-03-22 23:02:25 +03:00
|
|
|
|
{
|
2017-03-09 21:38:06 +03:00
|
|
|
|
[EditorBrowsable(EditorBrowsableState.Never)]
|
2018-01-31 21:09:15 +03:00
|
|
|
|
public interface IPerformanceProvider
|
2016-03-22 23:02:25 +03:00
|
|
|
|
{
|
2018-01-31 21:09:15 +03:00
|
|
|
|
void Stop(string reference, string tag, string path, string member);
|
2016-03-22 23:02:25 +03:00
|
|
|
|
|
2018-01-31 21:09:15 +03:00
|
|
|
|
void Start(string reference, string tag, string path, string member);
|
|
|
|
|
}
|
2016-03-22 23:02:25 +03:00
|
|
|
|
|
2018-01-31 21:09:15 +03:00
|
|
|
|
[EditorBrowsable(EditorBrowsableState.Never)]
|
|
|
|
|
public class Performance
|
|
|
|
|
{
|
|
|
|
|
public static IPerformanceProvider Provider { get; private set; }
|
2016-03-22 23:02:25 +03:00
|
|
|
|
|
2018-01-31 21:09:15 +03:00
|
|
|
|
public static void SetProvider(IPerformanceProvider instance)
|
2016-03-22 23:02:25 +03:00
|
|
|
|
{
|
2018-01-31 21:09:15 +03:00
|
|
|
|
Provider = instance;
|
2016-03-22 23:02:25 +03:00
|
|
|
|
}
|
|
|
|
|
|
2018-01-31 21:09:15 +03:00
|
|
|
|
public static void Start(string reference, string tag = null, [CallerFilePath] string path = null, [CallerMemberName] string member = null)
|
2016-03-22 23:02:25 +03:00
|
|
|
|
{
|
2018-01-31 21:09:15 +03:00
|
|
|
|
Provider?.Start(reference, tag, path, member);
|
2016-03-22 23:02:25 +03:00
|
|
|
|
}
|
|
|
|
|
|
2018-01-31 21:09:15 +03:00
|
|
|
|
public static void Stop(string reference, string tag = null, [CallerFilePath] string path = null, [CallerMemberName] string member = null)
|
2016-03-22 23:02:25 +03:00
|
|
|
|
{
|
2018-01-31 21:09:15 +03:00
|
|
|
|
Provider?.Stop(reference, tag, path, member);
|
2016-03-22 23:02:25 +03:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|