Module cpu

Source
Expand description

Information about, and functions to manage, your code’s resource utilization

Screeps documentation

Structs§

HeapStatistics
Object with info about the memory heap of your virtual machine.

Functions§

bucket
The amount of CPU that has accumulated in your bucket.
generate_pixelmmo
Generate a Pixel, consuming PIXEL_CPU_COST CPU from your bucket.
get_heap_statistics
Get information about your script’s memory heap usage.
get_used
Get the amount of CPU time used for execution so far this tick.
halt
Stop execution of your script immediately and requests the destruction of your code’s environment, which will start fresh on the following tick.
limit
Your assigned CPU for the current shard.
set_shard_limitsmmo
Set the allocation of your CPU among the server shards.
shard_limitsmmo
Your assigned CPU limits for each shard in an Object, with shard names in JsString form as keys and numbers as values. This is the same format accepted by set_shard_limits.
tick_limit
The amount of CPU available for execution in a given tick.
unlockmmo
Consume a CpuUnlock to unlock your full CPU for 24 hours.
unlockedmmo
Whether your account is unlocked to have full CPU.
unlocked_timemmo
If your account has been unlocked for a limited time, contains the time it’s unlocked until in milliseconds since epoch.