-
Notifications
You must be signed in to change notification settings - Fork 61
Open
Labels
Description
JavaFunction sleep = new JavaFunction(L) {
@Override
public int execute() throws LuaException {
int time = L.toInteger(2);
try {
Thread.sleep(time);
}catch (Exception e){
e.printStackTrace();
}
return 1;
}
};
sleep.register("sleep");
例子:
print(1)
sleep(6000)
print(2)
问题:sleep()和print等函数一起使用时,延时6秒后才同时打印出1和2(而不是先打1过6秒后打2)
有什么好方法吗?