mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-26 13:37:58 +01:00
7 lines
3.4 KiB
HTML
7 lines
3.4 KiB
HTML
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><base href="../../"><link rel="stylesheet" href="dmdoc.css"><title>code/__DEFINES/MC.dm - Space Station 13</title></head><body><header><a href="index.html">Space Station 13</a> - <a href="index.html#modules">Modules</a> - <a href="index.html#types">Types</a> — <a href="code/__DEFINES/MC.html#define">Define Details</a></header><main><h1>code/__DEFINES/MC.dm <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/__DEFINES/MC.dm"><img src="git.png" width="16" height="16" title="code/__DEFINES/MC.dm"></a></h1><table class="summary" cellspacing="0"><tr><th><a href="code/__DEFINES/MC.html#define/MC_AVG_OVER_TIME">MC_AVG_OVER_TIME</a></th><td>creates a running average of "things elapsed" per time period when you need to count via a smaller time period.
|
|
eg you want an average number of things happening per second but you measure the event every tick (50 milliseconds).
|
|
make sure both time intervals are in the same units. doesnt work if current_duration > total_duration or if total_duration == 0</td></tr><tr><th><a href="code/__DEFINES/MC.html#define/SS_BACKGROUND">SS_BACKGROUND</a></th><td>Subsystem only runs on spare cpu (after all non-background subsystems have ran that tick)
|
|
SS_BACKGROUND has its own priority bracket, this overrides SS_TICKER's priority bump</td></tr><tr><th><a href="code/__DEFINES/MC.html#define/SS_TICKER">SS_TICKER</a></th><td>(also forces it to run first in the tick (unless SS_BACKGROUND))</td></tr></table><h2 id="define">Define Details</h2><h3 id="define/MC_AVG_OVER_TIME"><aside class="declaration">#define </aside>MC_AVG_OVER_TIME<aside>(average, current, total_duration, current_duration)</aside> <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/__DEFINES/MC.dm#L23"><img src="git.png" width="16" height="16" title="code/__DEFINES/MC.dm 23"></a></h3><p>creates a running average of "things elapsed" per time period when you need to count via a smaller time period.
|
|
eg you want an average number of things happening per second but you measure the event every tick (50 milliseconds).
|
|
make sure both time intervals are in the same units. doesnt work if current_duration > total_duration or if total_duration == 0</p><h3 id="define/SS_BACKGROUND"><aside class="declaration">#define </aside>SS_BACKGROUND <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/__DEFINES/MC.dm#L46"><img src="git.png" width="16" height="16" title="code/__DEFINES/MC.dm 46"></a></h3><p>Subsystem only runs on spare cpu (after all non-background subsystems have ran that tick)
|
|
SS_BACKGROUND has its own priority bracket, this overrides SS_TICKER's priority bump</p><h3 id="define/SS_TICKER"><aside class="declaration">#define </aside>SS_TICKER <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/__DEFINES/MC.dm#L55"><img src="git.png" width="16" height="16" title="code/__DEFINES/MC.dm 55"></a></h3><p>(also forces it to run first in the tick (unless SS_BACKGROUND))</p></main><footer>paradise.dme <a href="https://github.com/ParadiseSS13/Paradise/tree/8a8a00a2a9bec485351e5f219982b7315d3504fa">8a8a00a</a> (master) — <a href="https://github.com/SpaceManiac/SpacemanDMM/blob/master/crates/dmdoc/README.md">dmdoc 1.11.0</a></footer></body></html> |