diff options
Merge branch 'queuetest' into careminster-presence-refactor
Diffstat (limited to 'OpenSim/Framework/Util.cs')
-rw-r--r-- | OpenSim/Framework/Util.cs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs index 3f676f9..366a38f 100644 --- a/OpenSim/Framework/Util.cs +++ b/OpenSim/Framework/Util.cs | |||
@@ -1549,6 +1549,23 @@ namespace OpenSim.Framework | |||
1549 | return (diff >= 0) ? diff : (diff + EnvironmentTickCountMask + 1); | 1549 | return (diff >= 0) ? diff : (diff + EnvironmentTickCountMask + 1); |
1550 | } | 1550 | } |
1551 | 1551 | ||
1552 | // Returns value of Tick Count A - TickCount B accounting for wrapping of TickCount | ||
1553 | // Assumes both tcA and tcB came from previous calls to Util.EnvironmentTickCount(). | ||
1554 | // A positive return value indicates A occured later than B | ||
1555 | public static Int32 EnvironmentTickCountCompare(Int32 tcA, Int32 tcB) | ||
1556 | { | ||
1557 | // A, B and TC are all between 0 and 0x3fffffff | ||
1558 | int tc = EnvironmentTickCount(); | ||
1559 | |||
1560 | if (tc - tcA >= 0) | ||
1561 | tcA += EnvironmentTickCountMask + 1; | ||
1562 | |||
1563 | if (tc - tcB >= 0) | ||
1564 | tcB += EnvironmentTickCountMask + 1; | ||
1565 | |||
1566 | return tcA - tcB; | ||
1567 | } | ||
1568 | |||
1552 | /// <summary> | 1569 | /// <summary> |
1553 | /// Prints the call stack at any given point. Useful for debugging. | 1570 | /// Prints the call stack at any given point. Useful for debugging. |
1554 | /// </summary> | 1571 | /// </summary> |