Asserts that given function does not take longer than the given number of milliseconds. When function is asynchronous then execution is immediately aborted
when timeout is reached. When function is synchronous then it is not possible to abort execution after reaching the timeout but an exception is thrown
as soon as the synchronous function returns.
Param: milliseconds
The maximum time (in milliseconds) the function is allowed to run.
Param: func
The function to run (can be synchronous or asynchronous).
Param: reason
Optional reason added to exception message when assertion fails.
Throws
AssertionError when function execution took longer than allowed.
Asserts that given function does not take longer than the given number of milliseconds. When function is asynchronous then execution is immediately aborted when timeout is reached. When function is synchronous then it is not possible to abort execution after reaching the timeout but an exception is thrown as soon as the synchronous function returns.
Param: milliseconds
The maximum time (in milliseconds) the function is allowed to run.
Param: func
The function to run (can be synchronous or asynchronous).
Param: reason
Optional reason added to exception message when assertion fails.
Throws
AssertionError when function execution took longer than allowed.