mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-05-21 23:22:04 +02:00
71 lines
1.1 KiB
Markdown
71 lines
1.1 KiB
Markdown
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
|
|
[Home](./index.md) > [bitburner](./bitburner.md) > [NS](./bitburner.ns.md) > [getFunctionRamCost](./bitburner.ns.getfunctionramcost.md)
|
|
|
|
## 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:**
|
|
|
|
```typescript
|
|
getFunctionRamCost(name: string): number;
|
|
```
|
|
|
|
## Parameters
|
|
|
|
<table><thead><tr><th>
|
|
|
|
Parameter
|
|
|
|
|
|
</th><th>
|
|
|
|
Type
|
|
|
|
|
|
</th><th>
|
|
|
|
Description
|
|
|
|
|
|
</th></tr></thead>
|
|
<tbody><tr><td>
|
|
|
|
name
|
|
|
|
|
|
</td><td>
|
|
|
|
string
|
|
|
|
|
|
</td><td>
|
|
|
|
The fully-qualified function name, without the leading `ns`<!-- -->.
|
|
|
|
|
|
</td></tr>
|
|
</tbody></table>
|
|
|
|
**Returns:**
|
|
|
|
number
|
|
|
|
## Remarks
|
|
|
|
RAM cost: 0 GB
|
|
|
|
## Example
|
|
|
|
|
|
```js
|
|
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');
|
|
```
|
|
|