mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-05-21 15:12:06 +02:00
1.1 KiB
1.1 KiB
Home > bitburner > NS > getFunctionRamCost
NS.getFunctionRamCost() method
Get the RAM cost of a netscript function.
The base RAM cost per script thread can also be retrieved by using "baseCost" as argument to this function.
Signature:
getFunctionRamCost(name: string): number;
Parameters
|
Parameter |
Type |
Description |
|---|---|---|
|
name |
string |
The fully-qualified function name, without the leading |
Returns:
number
Remarks
RAM cost: 0 GB
Example
const RAM_baseCost = ns.getFunctionRamCost('baseCost');
const RAM_for_hack = ns.getFunctionRamCost('hack');
const RAM_for_tprint = ns.getFunctionRamCost('tprint');
const RAM_for_stock_getPosition = ns.getFunctionRamCost('stock.getPosition');