/// <summary> /// 获取单例对象的方法 /// </summary> /// <returns></returns> public static TimeStatisticService GetTimeStatisticService() { if (uniqueTimeStatisticService != null) { return(uniqueTimeStatisticService); } lock (locker) { uniqueTimeStatisticService = new TimeStatisticService(); } return(uniqueTimeStatisticService); }
/// <summary> /// 释放单例对象 /// </summary> public static void Dispose() { uniqueTimeStatisticService = null; }