CPU: Difference between revisions
Jump to navigation
Jump to search
imported>Sam Hocevar (Start working on an article about CPU usage) |
imported>Sam Hocevar mNo edit summary |
||
| Line 1: | Line 1: | ||
Pico-8 keeps track of system usage using two values: a Lua instruction count, and a system usage. The function [[stat|<code>stat(1)</code>]] return the sum of these values, and [[stat|<code>stat(2)</code>]] returns the CPU usage. | Pico-8 keeps track of CPU system usage using two values: a Lua instruction count, and a system usage. The function [[stat|<code>stat(1)</code>]] return the sum of these values, and [[stat|<code>stat(2)</code>]] returns the CPU usage. | ||
== Functions with a system cost == | == Functions with a system cost == | ||
Revision as of 19:07, 19 December 2018
Pico-8 keeps track of CPU system usage using two values: a Lua instruction count, and a system usage. The function stat(1) return the sum of these values, and stat(2) returns the CPU usage.
Functions with a system cost
Only a handful of functions have a system cost:
| Function | Cost |
cls |
|
print |
|
spr |
|
sspr |
|
rect |
|
rectfill |
|
circ |
|
circfill |
|
line |
|
map / mapdraw |
|
music |
|
sfx |
|
memcpy |
|
memset |
|
reload |
|
rnd |
|
sqrt |
|
btn |
|
btnp |
|
stat |