Skip to content

Commit a0553dc

Browse files
committed
Use Environment.TickCount
1 parent 1c2bfdf commit a0553dc

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

ActivityGhosts/ActivityGhosts.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public class ActivityGhosts : Script
1818
{
1919
private List<Ghost> ghosts;
2020
private Blip start;
21-
private System.DateTime lastTime;
21+
private int lastTime;
2222
private Keys menuKey;
2323
public static PointF initialGPSPoint;
2424
public static int opacity;
@@ -27,7 +27,7 @@ public class ActivityGhosts : Script
2727
public ActivityGhosts()
2828
{
2929
ghosts = new List<Ghost>();
30-
lastTime = System.DateTime.UtcNow;
30+
lastTime = Environment.TickCount;
3131
LoadSettings();
3232
CreateMenu();
3333
Tick += OnTick;
@@ -36,11 +36,11 @@ public ActivityGhosts()
3636

3737
private void OnTick(object sender, EventArgs e)
3838
{
39-
if (System.DateTime.UtcNow >= lastTime.AddSeconds(1))
39+
if (Environment.TickCount >= lastTime + 1000)
4040
{
4141
foreach (Ghost g in ghosts)
4242
g.Update();
43-
lastTime = System.DateTime.UtcNow;
43+
lastTime = Environment.TickCount;
4444
}
4545

4646
if (showDate)
@@ -73,7 +73,7 @@ private void RegroupGhosts()
7373
{
7474
foreach (Ghost g in ghosts)
7575
g.Regroup(new PointF(Game.Player.Character.Position.X, Game.Player.Character.Position.Y));
76-
lastTime = System.DateTime.UtcNow;
76+
lastTime = Environment.TickCount;
7777
}
7878

7979
private void LoadGhosts()

0 commit comments

Comments
 (0)