bitburner-src/markdown/bitburner.gang.nextupdate.md

888 B

Home > bitburner > Gang > nextUpdate

Gang.nextUpdate() method

Sleeps until the next Gang update has happened.

Signature:

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

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
}