public static void StartStopwatch(string name) { if (!m_stopwatches.ContainsKey(name)) { var item = new StopwatchData(); m_stopwatches.Add(name, item); item.m_stopwatch = new Stopwatch(); } m_stopwatches[name].m_stopwatch.Start(); }
public static StopwatchData Get(Player p) { lock (GetLocker) { object obj; p.Extras.TryGet("STOPWATCH_DATA", out obj); if (obj != null) { return((StopwatchData)obj); } var timer = new StopwatchData(); p.Extras["STOPWATCH_DATA"] = timer; return(timer); } }