|
@@ -25,7 +25,7 @@ namespace ET
|
|
|
}
|
|
|
|
|
|
public long Id;
|
|
|
-
|
|
|
+
|
|
|
public TimerClass TimerClass;
|
|
|
|
|
|
public object Object;
|
|
@@ -35,7 +35,7 @@ namespace ET
|
|
|
public long Time;
|
|
|
|
|
|
public int Type;
|
|
|
-
|
|
|
+
|
|
|
public void Recycle()
|
|
|
{
|
|
|
this.Id = 0;
|
|
@@ -119,6 +119,11 @@ namespace ET
|
|
|
this.TimeId.Remove(time);
|
|
|
}
|
|
|
|
|
|
+ if (this.TimeId.Count == 0)
|
|
|
+ {
|
|
|
+ this.minTime = long.MaxValue;
|
|
|
+ }
|
|
|
+
|
|
|
while (this.timeOutTimerIds.Count > 0)
|
|
|
{
|
|
|
long timerId = this.timeOutTimerIds.Dequeue();
|
|
@@ -127,7 +132,7 @@ namespace ET
|
|
|
{
|
|
|
continue;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
this.Run(timerAction);
|
|
|
}
|
|
|
}
|
|
@@ -150,7 +155,7 @@ namespace ET
|
|
|
break;
|
|
|
}
|
|
|
case TimerClass.RepeatedTimer:
|
|
|
- {
|
|
|
+ {
|
|
|
long timeNow = GetNow();
|
|
|
timerAction.StartTime = timeNow;
|
|
|
this.AddTimer(timerAction);
|
|
@@ -299,7 +304,7 @@ namespace ET
|
|
|
throw new Exception($"repeated timer < 100, timerType: time: {time}");
|
|
|
}
|
|
|
#endif
|
|
|
-
|
|
|
+
|
|
|
long timeNow = GetNow();
|
|
|
TimerAction timer = TimerAction.Create(this.GetId(), TimerClass.RepeatedTimer, timeNow, time, type, args);
|
|
|
|