File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change 9
9
#include < iostream>
10
10
#include < fstream>
11
11
#include < string>
12
+ #include < chrono>
13
+ #include < thread>
12
14
#include " MiniScript/SimpleString.h"
13
15
#include " MiniScript/UnicodeUtil.h"
14
16
#include " MiniScript/UnitTest.h"
22
24
#include " ShellIntrinsics.h"
23
25
#include " DateTimeUtils.h" // TEMP for initial testing
24
26
27
+ // YIELD_NANOSECONDS: How many nano-seconds to sleep when yielding.
28
+ #define YIELD_NANOSECONDS 10000000
29
+
25
30
using namespace MiniScript ;
26
31
27
32
bool printHeaderInfo = true ;
@@ -127,6 +132,7 @@ static int DoCommand(Interpreter &interp, String cmd) {
127
132
while (!interp.Done ()) {
128
133
try {
129
134
interp.RunUntilDone ();
135
+ std::this_thread::sleep_for (std::chrono::nanoseconds (YIELD_NANOSECONDS));
130
136
} catch (MiniscriptException& mse) {
131
137
std::cerr << " Runtime Exception: " << mse.message << std::endl;
132
138
interp.vm ->Stop ();
You can’t perform that action at this time.
0 commit comments