private void uiTimerStartStop_Click(object sender, EventArgs e) { if (uiTimerStartStop.Text == "Timer Start") { // starts timing // usually you would time something inline like this using (var timer = AppStatsEngine.Time("SomeOperation")) { // some operation to time // the appstat is automatically published // when it is disposed } myTimer = AppStatsEngine.Time(uiTimerStatId.Text); uiTimerStartStop.Text = "Timer Stop"; } else { // stops timing // this will flush the timing data to the bus myTimer.Dispose(); myTimer = null; uiTimerStartStop.Text = "Timer Start"; } }
public static IAppStatsPieChartContinuation <AppStatsEngine.AppStatsEventTimer> PieChart(this AppStatsEngine.AppStatsEventTimer stat, string id) { stat.CheckId = id; return(stat); }