I'm developing a console like script for personal needs.
(我正在为个人需求开发类似脚本的控制台。)
I need to be able to pause for a extended amount of time, but, from my research, node.js has no way to stop as required.(我需要能够暂停很长一段时间,但是,根据我的研究,node.js无法按需停止。)
It's getting hard to read users' information after a period of time... I've seen some code out there, but I believe they have to have other code inside of them for them to work such as:(一段时间后,读取用户的信息变得越来越困难...我已经看到了一些代码,但是我相信他们必须在其中包含其他代码才能使他们工作,例如:)
setTimeout(function() {
}, 3000);
However, I need everything after this line of code to execute after the period of time.
(但是,我需要这段代码之后的所有内容才能在一段时间后执行。)
For example,
(例如,)
//start-of-code
console.log('Welcome to My Console,');
some-wait-code-here-for-ten-seconds..........
console.log('Blah blah blah blah extra-blah');
//endcode.
I've also seen things like
(我也看过类似的东西)
yield sleep(2000);
But node.js doesnt recognize this.
(但是node.js无法识别这一点。)
How can I achieve this extended pause?
(我如何才能实现这种长时间的暂停?)
ask by Christopher Allen translate from so
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…