0
0
mirror of https://github.com/phpv8/v8js.git synced 2024-12-22 18:41:52 +00:00

increase time limit to start engine

This commit is contained in:
Stefan Siegl 2014-12-10 19:27:04 +01:00
parent 1613570ced
commit 8b89a7b691

View File

@ -11,8 +11,8 @@ var jsfunc = function() {
var start = (new Date()).getTime();
var text = "abcdefghijklmnopqrstuvwyxz0123456789";
while ((new Date()).getTime() - start < 150) {
/* pass at least 150ms in the loop so the timer loop has plenty of
while ((new Date()).getTime() - start < 500) {
/* pass at least 500ms in the loop so the timer loop has plenty of
* time to trigger. */
var encoded = encodeURI(text);
}
@ -22,10 +22,10 @@ EOT;
$v8 = new V8Js();
/* Set very short time limit, but enough so v8 can start up safely. */
$v8->setTimeLimit(20);
$v8->setTimeLimit(100);
$v8->incrTimeLimit = function() use ($v8) {
$v8->setTimeLimit(100);
$v8->setTimeLimit(300);
};
$func = $v8->executeString($JS);
@ -43,5 +43,5 @@ try {
object(V8Function)#%d (0) {
}
V8JsTimeLimitException
Script time limit of 100 milliseconds exceeded
Script time limit of 300 milliseconds exceeded
===EOF===