add time functions, fix errorstream.isbpl
This commit is contained in:
parent
f57a98fe84
commit
a61427702e
2 changed files with 16 additions and 3 deletions
|
@ -728,6 +728,19 @@ public class ISBPL {
|
||||||
stack.push(toISBPLString(lastWords.get(n)));
|
stack.push(toISBPLString(lastWords.get(n)));
|
||||||
};
|
};
|
||||||
break;
|
break;
|
||||||
|
case "time":
|
||||||
|
func = (File file) -> {
|
||||||
|
ISBPLObject i = stack.pop();
|
||||||
|
long n = (long) i.toLong();
|
||||||
|
try {
|
||||||
|
Thread.sleep(n);
|
||||||
|
}
|
||||||
|
catch (InterruptedException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
stack.push(new ISBPLObject(getType("long"), System.currentTimeMillis()));
|
||||||
|
};
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
functionStack.peek().put(name, func);
|
functionStack.peek().put(name, func);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
native eputchar
|
native eputchar
|
||||||
|
|
||||||
func eputs {
|
func eputs {
|
||||||
def str _string =str
|
def str _array =str
|
||||||
1 neg =i
|
def i 1 neg =i
|
||||||
while { ( i 1 + =i ) ( i str alen lt ) } {
|
while { ( i 1 + =i ) ( i str alen lt ) } {
|
||||||
str i aget eputchar
|
str i aget eputchar
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue