Exemplo n.º 1
0
    public bool RefireMillis(long intervalMS)
    {
        long num = TimeGate.timeSource;

        if (!this.initialized)
        {
            this.initialized = true;
            this.startTime   = num;
            return(true);
        }
        if (intervalMS == 0)
        {
            bool flag = num != this.startTime;
            this.startTime = num;
            return(flag);
        }
        if (intervalMS < (long)0)
        {
            if (this.startTime - num > intervalMS)
            {
                return(false);
            }
            this.startTime = num;
            return(true);
        }
        if (num - this.startTime < intervalMS)
        {
            return(false);
        }
        TimeGate timeGate = this;

        timeGate.startTime = timeGate.startTime + intervalMS;
        return(true);
    }
Exemplo n.º 2
0
 public bool RefireSeconds(double intervalSeconds)
 {
     return(this.RefireMillis(TimeGate.SecondsToMS(intervalSeconds)));
 }
Exemplo n.º 3
0
 public bool ElapsedSeconds(double seconds)
 {
     return(seconds <= 0 || !this.initialized ? true : TimeGate.timeSource - this.startTime >= TimeGate.SecondsToMS(seconds));
 }