While double-checking how to get a timestamp that's consistent for multiple users, I arrived at GetServerTimeInSeconds, and then nearby noticed this:
"CalculateServerDeltaTime(double timeInSeconds, double previousTimeInSeconds)"
Which seemed weird? Why would there be a function for that, when you could just subtract one from the other with ordinary arithmetic?
I asked on the Discord, and someone informed me that it's because GetServerTimeInSeconds can
wrap
; apparently despite being a double, it's only a wrapper on GetServerTimeInMilliseconds, which is only an int.
If this is true, it would be good to mention this somewhere in the summary for GetServerTimeInSeconds, and/or CalculateServerDeltaTime, I think! i.e. in this table: https://udonsharp.docs.vrchat.com/vrchat-api/#networking
And honestly, it might also be nice to just provide some non-wrapping double too? (Maybe even just a convenience wrapper around GetNetworkDateTime().Ticks/10000000?)