ID:2085295
 
Resolved
world.tick_lag will round to the nearest millisecond instead of always rounding down, which will give more accurate times when setting it via world.fps.
BYOND Version:510.1341
Operating System:Windows 7 Ultimate 64-bit
Web Browser:Chrome 50.0.2661.102
Applies to:Dream Maker
Status: Resolved (510.1344)

This issue has been resolved.
Descriptive Problem Summary:

world
fps = 60

mob
Login()
world.log << world.fps
world.log << world.tick_lag


world.fps should be returning 60. It returns 63
world.tick_lag should be returning 0.1666666667. It returns 0.16

This causes frame timings to calculate inaccurately if you use the correct math.
O.o nice catch
I should probably change the world.fps calculation to round to the nearest millisecond instead of rounding down, as it does now. Setting world.fps to 60 will set tick_lag to 0.16. With rounding it will be 0.17, which is at least a little more accurate.

The limit of tick_lag's accuracy is 1 ms, so the only option is the better rounding. That would give world.fps a value of 59 on read, rather than 63. Changing the limit to a fractional ms value would be more difficult, requiring a network change (so perhaps doable for 511) at the very least; there are many places internally that milliseconds are measured with ints.
What I've decided to do here is change the compiler behavior to round tick_lag more accurately, so that setting world.fps=60 will read back as 59 instead of 63 (due to tick_lag being 0.17 instead of 0.16). I'm closing this report as fixed due to that behavior change.

However I think the spirit of this report is really that it'd be best if world.fps and world.time_lag were more accurate beyond the confines of a millisecond clock. That said, it sounds more like a feature request and would require a major version bump to achieve it, so I think a feature request is called for.
Lummox JR resolved issue with message:
world.tick_lag will round to the nearest millisecond instead of always rounding down, which will give more accurate times when setting it via world.fps.