mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-18 13:43:49 +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) =>
|
||||
(_time = 0) => {
|
||||
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 Promise.resolve(true);
|
||||
});
|
||||
@ -245,7 +245,7 @@ export const ns: InternalAPI<NSFull> = {
|
||||
(ctx) =>
|
||||
(_time = 0) => {
|
||||
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));
|
||||
},
|
||||
grow:
|
||||
|
Loading…
Reference in New Issue
Block a user