Files
fulpstation/code/datums/profiling.dm
John Willard 66d243abec tgu (#995)
* tgu

* tgui

* Fixes compile errors & Updates Beefmen

* Smartfridges

* Coroner stuff

* fix helio fridges

* ci errors

* Update russian.dm

* Pubby Fix (#58)

among us

* helio fix and wounds fix

* re-adds features

* Adds a mentor log category

* Update exiled_king_basic.dm (#59)

---------

Co-authored-by: Ray <64306407+OneAsianTortoise@users.noreply.github.com>
Co-authored-by: SMOSMOSMOSMOSMO <95004236+SmoSmoSmoSmok@users.noreply.github.com>
2023-06-06 14:46:43 -04:00

19 lines
726 B
Plaintext

//these are real globals so you can use profiling to profile early world init stuff.
GLOBAL_REAL(PROFILE_STORE, /list)
GLOBAL_REAL_VAR(PROFILE_LINE)
GLOBAL_REAL_VAR(PROFILE_FILE)
GLOBAL_REAL_VAR(PROFILE_SLEEPCHECK)
GLOBAL_REAL_VAR(PROFILE_TIME)
/proc/profile_show(user, sort = GLOBAL_PROC_REF(cmp_profile_avg_time_dsc))
sortTim(PROFILE_STORE, sort, TRUE)
var/list/lines = list()
for (var/entry in PROFILE_STORE)
var/list/data = PROFILE_STORE[entry]
lines += "[entry] => [num2text(data[PROFILE_ITEM_TIME], 10)]ms ([data[PROFILE_ITEM_COUNT]]) (avg:[num2text(data[PROFILE_ITEM_TIME]/(data[PROFILE_ITEM_COUNT] || 1), 99)])"
user << browse("<ol><li>[lines.Join("</li><li>")]</li></ol>", "window=[url_encode(GUID())]")