Esempio n. 1
0
        /// <summary>
        /// 得到当前的观察时间
        /// </summary>
        /// <returns></returns>
        public double GetWatchTime()
        {
            RecordWatchEntity entity = CurrentWatch;

            if (entity == null)
            {
                LCSConsole.WriteError("观察还未开始...");
                return(0);
            }
            if (entity.IsWatch)
            {
                LCSConsole.WriteError("观察还未结束...");
                return(0);
            }
            return(entity.GetWatchTime());
        }
Esempio n. 2
0
        /// <summary>
        /// 结束观察
        /// </summary>
        public double EndWatch()
        {
            RecordWatchEntity entity = CurrentWatch;

            if (entity == null)
            {
                LCSConsole.WriteError("观察还未开始...");
                return(0);
            }
            entity.EndWatch();
            double watchTime = entity.GetWatchTime();

            // 7位精度
            LCSConsole.WriteWarning("[Watch] {0} use time : {1}s.", entity.WatchKey, watchTime.ToString("F7"));
            return(watchTime);
        }