diff options
Diffstat (limited to 'OpenSim/Framework/Util.cs')
-rw-r--r-- | OpenSim/Framework/Util.cs | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs index a695542..d89bb3a 100644 --- a/OpenSim/Framework/Util.cs +++ b/OpenSim/Framework/Util.cs | |||
@@ -1770,13 +1770,26 @@ namespace OpenSim.Framework | |||
1770 | /// and negative every 24.9 days. Subtracts the passed value (previously fetched by | 1770 | /// and negative every 24.9 days. Subtracts the passed value (previously fetched by |
1771 | /// 'EnvironmentTickCount()') and accounts for any wrapping. | 1771 | /// 'EnvironmentTickCount()') and accounts for any wrapping. |
1772 | /// </summary> | 1772 | /// </summary> |
1773 | /// <param name="newValue"></param> | ||
1774 | /// <param name="prevValue"></param> | ||
1773 | /// <returns>subtraction of passed prevValue from current Environment.TickCount</returns> | 1775 | /// <returns>subtraction of passed prevValue from current Environment.TickCount</returns> |
1774 | public static Int32 EnvironmentTickCountSubtract(Int32 prevValue) | 1776 | public static Int32 EnvironmentTickCountSubtract(Int32 newValue, Int32 prevValue) |
1775 | { | 1777 | { |
1776 | Int32 diff = EnvironmentTickCount() - prevValue; | 1778 | Int32 diff = newValue - prevValue; |
1777 | return (diff >= 0) ? diff : (diff + EnvironmentTickCountMask + 1); | 1779 | return (diff >= 0) ? diff : (diff + EnvironmentTickCountMask + 1); |
1778 | } | 1780 | } |
1779 | 1781 | ||
1782 | /// <summary> | ||
1783 | /// Environment.TickCount is an int but it counts all 32 bits so it goes positive | ||
1784 | /// and negative every 24.9 days. Subtracts the passed value (previously fetched by | ||
1785 | /// 'EnvironmentTickCount()') and accounts for any wrapping. | ||
1786 | /// </summary> | ||
1787 | /// <returns>subtraction of passed prevValue from current Environment.TickCount</returns> | ||
1788 | public static Int32 EnvironmentTickCountSubtract(Int32 prevValue) | ||
1789 | { | ||
1790 | return EnvironmentTickCountSubtract(EnvironmentTickCount(), prevValue); | ||
1791 | } | ||
1792 | |||
1780 | // Returns value of Tick Count A - TickCount B accounting for wrapping of TickCount | 1793 | // Returns value of Tick Count A - TickCount B accounting for wrapping of TickCount |
1781 | // Assumes both tcA and tcB came from previous calls to Util.EnvironmentTickCount(). | 1794 | // Assumes both tcA and tcB came from previous calls to Util.EnvironmentTickCount(). |
1782 | // A positive return value indicates A occured later than B | 1795 | // A positive return value indicates A occured later than B |