示例#1
0
 public SimpleInterval(DateTime startTime, TimeSpan interval, DateTime endTime)
 {
     _startTime = startTime.RoundToSqlDateTime();
     _interval = interval;
     _endTime = endTime.RoundToSqlDateTime();
 }
示例#2
0
        private DateTime NextRunTimeInternal(DateTime time, bool includeStartTime)
        {
            var _time = time.RoundToSqlDateTime();
            var span = _time - this.StartTime;

            if (this.Interval <= TimeSpan.Zero || span < TimeSpan.Zero)
                return this.StartTime;

            if (span.Ticks % this.Interval.Ticks == 0)
                return includeStartTime ? _time : _time + this.Interval;

            return _time + (this.Interval - span);
        }
示例#3
0
 public SimpleInterval(DateTime startTime, TimeSpan interval, int count)
 {
     _startTime = startTime.RoundToSqlDateTime();
     _interval = interval;
     _endTime = _startTime + TimeSpan.FromTicks(_interval.Ticks * count);
 }