Skip to content

Commit

Permalink
Timeout in ms
Browse files Browse the repository at this point in the history
  • Loading branch information
Gustaf Sjoberg committed Sep 22, 2016
1 parent 54e0037 commit 5e60638
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion c_src/vm.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ void* TimeoutHandler(void *arg) {
struct TimeoutHandlerArgs *args = (struct TimeoutHandlerArgs*)arg;

FTRACE("Timeout handler started: %i\n", args->timeout);
usleep(args->timeout);
usleep(args->timeout * 1000);
TRACE("Timeout expired. Terminating execution.\n");

pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, 0x00);
Expand Down
2 changes: 1 addition & 1 deletion test/port_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ timeout(_Config) ->
{ok, undefined} = erlang_v8:eval(VM, Context1, <<"var x = 1;">>),
{ok, 1} = erlang_v8:eval(VM, Context1, <<"x">>),

{error, timeout} = erlang_v8:eval(VM, Context2, <<"while (true) {}">>, 1000),
{error, timeout} = erlang_v8:eval(VM, Context2, <<"while (true) {}">>, 500),

{ok, 1} = erlang_v8:eval(VM, Context1, <<"x">>),

Expand Down

0 comments on commit 5e60638

Please sign in to comment.