diff options
author | UbitUmarov | 2016-11-09 11:21:46 +0000 |
---|---|---|
committer | UbitUmarov | 2016-11-09 11:21:46 +0000 |
commit | c349a1a5e76a97d8b421afedcbb6320e846404ad (patch) | |
tree | c2cfdf523329e5fae01005defcdc917c7936c82c /OpenSim | |
parent | change the clock source on udp outgoing, remove some dead code (diff) | |
download | opensim-SC_OLD-c349a1a5e76a97d8b421afedcbb6320e846404ad.zip opensim-SC_OLD-c349a1a5e76a97d8b421afedcbb6320e846404ad.tar.gz opensim-SC_OLD-c349a1a5e76a97d8b421afedcbb6320e846404ad.tar.bz2 opensim-SC_OLD-c349a1a5e76a97d8b421afedcbb6320e846404ad.tar.xz |
also log estimated average Util.GetTimeStampMS() resolution
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs index 8355f2b..ffdb639 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs | |||
@@ -444,10 +444,22 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
444 | int now = start; | 444 | int now = start; |
445 | while (now == start) | 445 | while (now == start) |
446 | now = Environment.TickCount; | 446 | now = Environment.TickCount; |
447 | TickCountResolution += (float)(now - start) * 0.1f; | 447 | TickCountResolution += (float)(now - start); |
448 | } | 448 | } |
449 | TickCountResolution = (float)Math.Ceiling(TickCountResolution); | 449 | m_log.Info("[LLUDPSERVER]: Average Environment.TickCount resolution: " + TickCountResolution * 0.1f + "ms"); |
450 | m_log.Info("[LLUDPSERVER]: Average Environment.TickCount resolution: " + TickCountResolution + "ms"); | 450 | |
451 | TickCountResolution = 0f; | ||
452 | for (int i = 0; i < 100; i++) | ||
453 | { | ||
454 | double start = Util.GetTimeStampMS(); | ||
455 | double now = start; | ||
456 | while (now == start) | ||
457 | now = Util.GetTimeStampMS(); | ||
458 | TickCountResolution += (float)((now - start)); | ||
459 | } | ||
460 | |||
461 | TickCountResolution = (float)Math.Round(TickCountResolution * 0.01f,6,MidpointRounding.AwayFromZero); | ||
462 | m_log.Info("[LLUDPSERVER]: Average Util.GetTimeStampMS resolution: " + TickCountResolution + "ms"); | ||
451 | 463 | ||
452 | #endregion Environment.TickCount Measurement | 464 | #endregion Environment.TickCount Measurement |
453 | 465 | ||