mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-18 21:53:50 +01:00
Format time in ns.sleep and ns.asleep (#806)
This commit is contained in:
parent
47176b7809
commit
b9d13063ac
@ -236,7 +236,7 @@ export const ns: InternalAPI<NSFull> = {
|
|||||||
(ctx) =>
|
(ctx) =>
|
||||||
(_time = 0) => {
|
(_time = 0) => {
|
||||||
const time = helpers.number(ctx, "time", _time);
|
const time = helpers.number(ctx, "time", _time);
|
||||||
helpers.log(ctx, () => `Sleeping for ${time} milliseconds`);
|
helpers.log(ctx, () => `Sleeping for ${convertTimeMsToTimeElapsedString(time, true)}.`);
|
||||||
return helpers.netscriptDelay(ctx, time).then(function () {
|
return helpers.netscriptDelay(ctx, time).then(function () {
|
||||||
return Promise.resolve(true);
|
return Promise.resolve(true);
|
||||||
});
|
});
|
||||||
@ -245,7 +245,7 @@ export const ns: InternalAPI<NSFull> = {
|
|||||||
(ctx) =>
|
(ctx) =>
|
||||||
(_time = 0) => {
|
(_time = 0) => {
|
||||||
const time = helpers.number(ctx, "time", _time);
|
const time = helpers.number(ctx, "time", _time);
|
||||||
helpers.log(ctx, () => `Sleeping for ${time} milliseconds`);
|
helpers.log(ctx, () => `Sleeping for ${convertTimeMsToTimeElapsedString(time, true)}.`);
|
||||||
return new Promise((resolve) => setTimeout(() => resolve(true), time));
|
return new Promise((resolve) => setTimeout(() => resolve(true), time));
|
||||||
},
|
},
|
||||||
grow:
|
grow:
|
||||||
|
Loading…
Reference in New Issue
Block a user