Do sleep commands round up to tick lag?? meaning that the maximum precision we can have is 100ms??
|
Aug 10 2017, 11:26 am
Best response
|
|
They round, yes. If you want more precision you need a faster FPS.
|
Thanks I tested it also and I had different times when changing fps. Its just that in the reference it says that sleep works with 1/10 of seconds and not ticks. also I noticed that sleeps also takes 0.1 as argument so I can go as low as 10ms right??
|
The value in sleep() is always in terms of standard ticks, for legacy reasons, but internally it's always changed to an integer number of server ticks--which happen at whatever rate is specified by tick_lag or fps.
Sleeping a fractional number of server ticks is of course not possible, as there's no such concept. If your world runs at 100 FPS--which is really more of a theoretical concept than a practical one--then yes, 10 ms would be fine. In practice, running the server at that speed is problematic. |