Namespace v8
Namespace for general extension functions
Defined in: v8.js.
Constructor Attributes | Constructor Name and Description |
---|---|
Field Attributes | Field Name and Description |
---|---|
<static> <constant> |
v8.version
Version number of the V8 JavaScript engine.
|
Method Attributes | Method Name and Description |
---|---|
<static> |
v8.sleep(milliseconds)
Sleep for a while.
|
<static> |
v8.timeout(milliseconds, func, _this)
This function implements a simple timeout functionality.
|
Field Detail
<static> <constant>
{String}
v8.version
Version number of the V8 JavaScript engine.
Method Detail
<static>
v8.sleep(milliseconds)
Sleep for a while. This can be used to just wait or give time
back to the operating system to produce less CPU load if the
main purpose of a loop is, e.g., to wait for something to happen.
- Parameters:
- {Integer} milliseconds Optional, Default: 0
- Number of millliseconds to sleep. Note that even 0 will always sleep at least one millisecond.
<static>
v8.timeout(milliseconds, func, _this)
This function implements a simple timeout functionality.
back to the operating system to produce less CPU load if the
main purpose of a loop is, e.g., to wait for something to happen.
- Parameters:
- {Integer} milliseconds
- Number of millliseconds until the timeout. Note that even 0 will execute the function at least once. If the timeout is negative no exception will be thrown by undefined will be returned in case of a timeout.
- {Function} func
- A function. The function defines when the conditional to end the timeout will be fullfilled. As soon as the function returns a defined value, i.e. something else than undefined, the timeout is stopped and its return value is returned.
- {Object} _this Optional
- An object which will be the reference for 'this' in the function call. If none is given, the function itself will be the 'this' object.
- . . . Optional
- Any further argument will be passed as argument to the function.
- Throws:
- When the number or type of argument is wrong
- In case the timeout is positive and the timeout condition occurs
- Returns:
- Whatever is returned by the function. undefined in case of timeout and a negative timeout value.