perf counter for synchash

This commit is contained in:
Chris Forbes
2010-01-09 15:09:30 +13:00
parent ae979466a8
commit 66b5277a73

View File

@@ -1,6 +1,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using OpenRa.Game.Effects; using OpenRa.Game.Effects;
using OpenRa.Game.Support;
namespace OpenRa.Game namespace OpenRa.Game
{ {
@@ -54,12 +55,15 @@ namespace OpenRa.Game
} }
public int SyncHash() public int SyncHash()
{
using (new PerfSample("synchash"))
{ {
int ret = 0; int ret = 0;
foreach( var a in Actors ) foreach (var a in Actors)
ret += (int)a.ActorID * Sync.CalculateSyncHash( a ); ret += (int)a.ActorID * Sync.CalculateSyncHash(a);
return ret; return ret;
} }
} }
}
} }