public hwmPerformanceStatisticsItem Finish(string itemName) { hwmPerformanceStatisticsItem item = LoadOrCreateItem(itemName); Finish(item); return(item); }
public hwmPerformanceStatisticsItem LoadOrCreateItem(string itemName, bool ignoreHistoryOnLoad = false) { hwmPerformanceStatisticsItem item; if (!m_Items.TryGetValue(itemName, out item)) { item = new hwmPerformanceStatisticsItem(); item._Name = itemName; item._Stopwatch = new Stopwatch(); item._Stopwatch.Reset(); item._Historys = new List <hwmPerformanceStatisticsItem.History>(); if (!ignoreHistoryOnLoad) { string itemFilePath = m_RecordDirectory + itemName + ".txt"; if (File.Exists(itemFilePath)) { string[] historyLines = File.ReadAllLines(itemFilePath); for (int iHistory = 0; iHistory < historyLines.Length; iHistory++) { string iterLine = historyLines[iHistory]; hwmPerformanceStatisticsItem.History history; if (hwmPerformanceStatisticsItem.TryDeserializeHistory(iterLine, out history)) { item._Historys.Add(history); } } } } m_Items.Add(itemName, item); } return(item); }
public hwmPerformanceStatisticsItem Resume(string itemName) { hwmPerformanceStatisticsItem item = LoadOrCreateItem(itemName); Resume(item); return(item); }
public hwmPerformanceStatisticsItem ClearHistory(string itemName) { hwmPerformanceStatisticsItem item = LoadOrCreateItem(itemName); ClearHistory(item); return(item); }
public void Finish(hwmPerformanceStatisticsItem item) { item._Stopwatch.Stop(); hwmPerformanceStatisticsItem.History history = new hwmPerformanceStatisticsItem.History(); history._Ticks = item._Stopwatch.ElapsedTicks; item._Historys.Add(history); }
public void Start(hwmPerformanceStatisticsItem item) { item._Stopwatch.Reset(); item._Stopwatch.Start(); }
public void Start(hwmPerformanceStatisticsItem item) { }
public void Resume(hwmPerformanceStatisticsItem item) { }
public void Pause(hwmPerformanceStatisticsItem item) { }
public void Finish(hwmPerformanceStatisticsItem item) { }
public void ClearHistory(hwmPerformanceStatisticsItem item) { }
public void Resume(hwmPerformanceStatisticsItem item) { item._Stopwatch.Start(); }
public void Pause(hwmPerformanceStatisticsItem item) { item._Stopwatch.Stop(); }
public void ClearHistory(hwmPerformanceStatisticsItem item) { item._Historys.Clear(); }