874
edits
(Added link to reference implementation) |
(→Modules: added timer module) |
||
| Line 108: | Line 108: | ||
The following modules come built-in with Cuddlefish and can be retrieved with a call to <tt>require()</tt>. | The following modules come built-in with Cuddlefish and can be retrieved with a call to <tt>require()</tt>. | ||
=== <tt>timer</tt> === | |||
The <tt>timer</tt> module provides access to web-like timing functionality. | |||
<tt>timer.'''setTimeout'''(''callback'', ''ms'')</tt> | |||
Schedules ''callback'' to be called in ''ms'' milliseconds. Returns an integer ID that can later be used to undo this scheduling, if ''callback'' hasn't yet been called. | |||
<tt>timer.'''clearTimeout'''(''id'')</tt> | |||
Given an integer ID passed back from <tt>setTimeout()</tt>, prevents the callback with the ID from being called (if it hasn't yet been called). | |||
=== <tt>url</tt> === | === <tt>url</tt> === | ||
edits