Beispiel #1
0
        protected override void afterRead()
        {
            //修复逻辑
            if (timePass < 0)
            {
                timePass = 0;
            }

            _lastCheckTime = DateControl.getTimeMillis();
        }
Beispiel #2
0
        /// <summary>
        /// 创建一个结束计时的
        /// </summary>
        public static TimePassData createForOver(int timeMax)
        {
            TimePassData re = new TimePassData();

            re.timeMax        = timeMax;
            re.timePass       = timeMax;
            re._lastCheckTime = DateControl.getTimeMillis();

            return(re);
        }
Beispiel #3
0
        /** 输出到控制台 */
        private static void doPrintToConsole(string str, bool isError)
        {
            if (ShineSetting.consoleNeedTimestamp)
            {
                str = TimeUtils.getTimeStr(DateControl.getTimeMillis()) + " " + str;
            }

            if (isError)
            {
                Debug.LogError(str);
            }
            else
            {
                Debug.Log(str);
            }

            if (_printFunc != null)
            {
                _printFunc(str);
            }
        }
Beispiel #4
0
        public void runTime()
        {
            long time = DateControl.getTimeMillis();

            if (!isNone())
            {
                //未暂停
                if (!_isPause)
                {
                    int delay = (int)(time - _lastCheckTime);

                    if (delay > 0)
                    {
                        toAddTime(delay);
                        checkAddMax();
                    }
                }
            }

            _lastCheckTime = time;
        }
Beispiel #5
0
 /** 获取上个时间 */
 public long getPrevTime()
 {
     return(getPrevTime(DateControl.getTimeMillis()));
 }
Beispiel #6
0
 public virtual void reStart()
 {
     timePass       = 0;
     _lastCheckTime = DateControl.getTimeMillis();
 }
Beispiel #7
0
 /** 写时间戳 */
 public void putTimestamp()
 {
     put("timestamp", DateControl.getTimeMillis());
 }
Beispiel #8
0
 /** 获取明天0点(ms) */
 public static long getNextDailyTimeFromNow()
 {
     return(getNextDailyTime(DateControl.getTimeMillis()));
 }
Beispiel #9
0
 /** 获取下一个cron时刻,从当前开始(ms) */
 public static long getNextCronTimeFromNow(string cron)
 {
     return(getNextCronTime(cron, DateControl.getTimeMillis()));
 }
Beispiel #10
0
 /** 获取下一个cron时刻(ms) */
 public static long getNextCronTimeFromNow(CronExpression cron)
 {
     return(getNextCronTime(cron, DateControl.getTimeMillis()));
 }