* Adds defines for world.tick_usage
* This provides no useful benefit whatsoever, but /tg and Baystation12 have done it, so it will make porting future code easier if we do too.  No real harm done either.
This commit is contained in:
Leshana
2017-12-27 19:10:15 -05:00
parent 032d26010b
commit c6e8184b58
10 changed files with 35 additions and 33 deletions

View File

@@ -150,7 +150,7 @@ SUBSYSTEM_DEF(garbage)
//this is purely to seperate things profile wise.
/datum/controller/subsystem/garbage/proc/HardDelete(datum/A)
var/time = world.timeofday
var/tick = world.tick_usage
var/tick = TICK_USAGE
var/ticktime = world.time
var/type = A.type
@@ -158,7 +158,7 @@ SUBSYSTEM_DEF(garbage)
del(A)
tick = (world.tick_usage-tick+((world.time-ticktime)/world.tick_lag*100))
tick = (TICK_USAGE-tick+((world.time-ticktime)/world.tick_lag*100))
if (tick > highest_del_tickusage)
highest_del_tickusage = tick
time = world.timeofday - time

View File

@@ -50,27 +50,27 @@ SUBSYSTEM_DEF(lighting)
stage = SSLIGHTING_STAGE_LIGHTS // Start with Step 1 of course
if(stage == SSLIGHTING_STAGE_LIGHTS)
timer = world.tick_usage
timer = TICK_USAGE
internal_process_lights(resumed)
cost_lights = MC_AVERAGE(cost_lights, TICK_DELTA_TO_MS(world.tick_usage - timer))
cost_lights = MC_AVERAGE(cost_lights, TICK_DELTA_TO_MS(TICK_USAGE - timer))
if(state != SS_RUNNING)
return
resumed = 0
stage = SSLIGHTING_STAGE_CORNERS
if(stage == SSLIGHTING_STAGE_CORNERS)
timer = world.tick_usage
timer = TICK_USAGE
internal_process_corners(resumed)
cost_corners = MC_AVERAGE(cost_corners, TICK_DELTA_TO_MS(world.tick_usage - timer))
cost_corners = MC_AVERAGE(cost_corners, TICK_DELTA_TO_MS(TICK_USAGE - timer))
if(state != SS_RUNNING)
return
resumed = 0
stage = SSLIGHTING_STAGE_OVERLAYS
if(stage == SSLIGHTING_STAGE_OVERLAYS)
timer = world.tick_usage
timer = TICK_USAGE
internal_process_overlays(resumed)
cost_overlays = MC_AVERAGE(cost_overlays, TICK_DELTA_TO_MS(world.tick_usage - timer))
cost_overlays = MC_AVERAGE(cost_overlays, TICK_DELTA_TO_MS(TICK_USAGE - timer))
if(state != SS_RUNNING)
return
resumed = 0