mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-22 23:53:48 +01:00
38 lines
888 B
Markdown
38 lines
888 B
Markdown
|
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||
|
|
||
|
[Home](./index.md) > [bitburner](./bitburner.md) > [Gang](./bitburner.gang.md) > [nextUpdate](./bitburner.gang.nextupdate.md)
|
||
|
|
||
|
## Gang.nextUpdate() method
|
||
|
|
||
|
Sleeps until the next Gang update has happened.
|
||
|
|
||
|
**Signature:**
|
||
|
|
||
|
```typescript
|
||
|
nextUpdate(): Promise<number>;
|
||
|
```
|
||
|
**Returns:**
|
||
|
|
||
|
Promise<number>
|
||
|
|
||
|
Promise that resolves to the number of milliseconds of Gang time that were processed in the previous update (2000 - 5000 ms).
|
||
|
|
||
|
## Remarks
|
||
|
|
||
|
RAM cost: 1 GB
|
||
|
|
||
|
The amount of real time spent asleep between updates can vary due to "bonus time".
|
||
|
|
||
|
## Example
|
||
|
|
||
|
|
||
|
```js
|
||
|
while (true) {
|
||
|
const duration = await ns.gang.nextUpdate();
|
||
|
ns.print(`Gang completed ${ns.tFormat(duration)} of activity.`);
|
||
|
ns.print(`Bonus time remaining: ${ns.tFormat(ns.gang.getBonusTime())}`);
|
||
|
// Manage the Gang
|
||
|
}
|
||
|
```
|
||
|
|