Numbered Steps to Reproduce Problem: Run code below
Code Snippet (if applicable) to Reproduce Problem:
/world/New()
world.log << "first tick: [num2text(world.tick_usage, 20)]"
sleep(0.1)
world.log << "second tick: [num2text(world.tick_usage, 20)]"
for(var/i in 1 to 1000000)
. = "a loop to use some time"
world.log << "second tick, later: [num2text(world.tick_usage, 20)]"
Expected Results:
first tick: (a small value)
second tick: (a different small value)
second tick, later: (a larger value corresponding to the time the loop took)
Actual Results:
first tick: 13272397905920
second tick: 0.0020000000949949026108
second tick, later: 62.88899993896484375
(note that, if interpreted in milliseconds as the other figures are, a value of 13272397905920 suggests the tick has been executing for about 420 years, 7 months - very close to 1st Jan 1601, which is Windows' epoch - perhaps a missing initialisation at startup?)
Does the problem occur:
Every time? Or how often? Every time
In other games? Yes
In other user accounts? Unknown
On other computers? Unknown
When does the problem NOT occur? After the first tick has finished.
Did the problem NOT occur in any earlier versions? If so, what was the last version that worked? Last working in 514.1545, broken in 514.1546 and all later versions that I tested, including 514.1560.
Workarounds: Wait until the second tick before using world.tick_usage?
EDIT: Hm. I swear it was the time since stopping the previous server a moment ago, but now it's the time since starting the previous server. I probably just messed up my testing.
EDIT: Also, yes, I can confirm that the first value it gives is exactly what you suspected, to the nearest 32-bit floating point value.