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 99#include < iostream>
1010#include < fstream>
1111#include < string>
12+ #include < chrono>
13+ #include < thread>
1214#include " MiniScript/SimpleString.h"
1315#include " MiniScript/UnicodeUtil.h"
1416#include " MiniScript/UnitTest.h"
2224#include " ShellIntrinsics.h"
2325#include " DateTimeUtils.h" // TEMP for initial testing
2426
27+ // YIELD_NANOSECONDS: How many nano-seconds to sleep when yielding.
28+ #define YIELD_NANOSECONDS 10000000
29+
2530using namespace MiniScript ;
2631
2732bool printHeaderInfo = true ;
@@ -127,6 +132,7 @@ static int DoCommand(Interpreter &interp, String cmd) {
127132 while (!interp.Done ()) {
128133 try {
129134 interp.RunUntilDone ();
135+ std::this_thread::sleep_for (std::chrono::nanoseconds (YIELD_NANOSECONDS));
130136 } catch (MiniscriptException& mse) {
131137 std::cerr << " Runtime Exception: " << mse.message << std::endl;
132138 interp.vm ->Stop ();
You can’t perform that action at this time.
0 commit comments