Search Unity

System.Environment.TickCount inaccuracies on iOS

Discussion in 'iOS and tvOS' started by chand81, Mar 23, 2017.

  1. chand81

    chand81

    Joined:
    Jun 2, 2011
    Posts:
    25
    System.Environment.TickCount seems to be inaccurate on iOS.
    Using: Unity 5.4.3f1, iOS 8.2, iPad Mini
    Logging System.Environment.TickCount on launch gives the following values (samples are in chronological order):

    TickCount Delta from previous
    -940502954
    -940503130 -176
    -940502835 295
    -940503575 -740
    -940503154 421
    -940503113 41

    As can be seen above, some of the delta values are negative.

    TickCount behaves as expected on Android.

    Unity 5.0.1p4 has a TickCount related fix. How to know if this fix is there in Unity 5.4.3f1 ?
    https://unity3d.com/unity/qa/patch-releases/5.0.1p4
    • (687587) - iOS/IL2CPP: Fixed System.Environment.TickCount on iOS.
    Also, would be good to know, what exactly was the issue the above fix addressed.

    Thanks.
     
  2. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,931
    This bug is corrected in 5.4.3f1. The original fix was to remove an undesired 64-bit to 32-bit integer truncation that was cause the VM runtime code to loose information. Can you submit a bug report for this issue?
     
  3. chand81

    chand81

    Joined:
    Jun 2, 2011
    Posts:
    25