Xamarin.Insights.TrackTime Method
TrackTime allows the developer to track events that make take an amount of time to complete. For example measuring how long it takes to submit login information to a remote server.

Syntax

public static ITrackHandle TrackTime (string identifier, IDictionary<string, string> table)

Parameters

identifier
A unique identifier name for this event.
table
An optional key/value store representing additional data that the developer would like to attach to this time track.

Returns

A handler object that allows the developer to start and stop the built in timer.

Remarks

This shows how to use this method with a using keyword:

C# Example

using (var handle = Insights.TrackTime("TimeToLogin")) {
   await SubmitLoginInformation("myuserid", "mypassword");
   ... more code goes here ...
 }
            

If the developer does not wish to use the using keyword or wants to track events in more complex scenarios they can use the Start and Stop methods on the handle object:

C# Example

var handle = Insights.TrackTime("TimeToLogin");
handle.Start();
await SubmitLoginInformation("myuserid", "mypassword");
... more code goes here ...
handle.Stop();
            

Requirements

Namespace: Xamarin
Assembly: Xamarin.Insights (in Xamarin.Insights.dll)
Assembly Versions: 0.2.0.0, 1.0.0.0