also log estimated average Util.GetTimeStampMS() resolution

melanie
UbitUmarov 2016-11-09 11:21:46 +00:00
parent 94d2422230
commit c349a1a5e7
1 changed files with 15 additions and 3 deletions

View File

@ -444,10 +444,22 @@ namespace OpenSim.Region.ClientStack.LindenUDP
int now = start;
while (now == start)
now = Environment.TickCount;
TickCountResolution += (float)(now - start) * 0.1f;
TickCountResolution += (float)(now - start);
}
TickCountResolution = (float)Math.Ceiling(TickCountResolution);
m_log.Info("[LLUDPSERVER]: Average Environment.TickCount resolution: " + TickCountResolution + "ms");
m_log.Info("[LLUDPSERVER]: Average Environment.TickCount resolution: " + TickCountResolution * 0.1f + "ms");
TickCountResolution = 0f;
for (int i = 0; i < 100; i++)
{
double start = Util.GetTimeStampMS();
double now = start;
while (now == start)
now = Util.GetTimeStampMS();
TickCountResolution += (float)((now - start));
}
TickCountResolution = (float)Math.Round(TickCountResolution * 0.01f,6,MidpointRounding.AwayFromZero);
m_log.Info("[LLUDPSERVER]: Average Util.GetTimeStampMS resolution: " + TickCountResolution + "ms");
#endregion Environment.TickCount Measurement