mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-06-11 23:59:01 +00:00
Updated AsyncFunction (markdown)
parent
32eab6062b
commit
8e7bc4d4b5
|
@ -7,9 +7,13 @@ JScript does not support the `async` keyword. So, Wilson JS uses the `AsyncFunct
|
|||
```js
|
||||
var STD = require("lib/std");
|
||||
|
||||
[5, 4, 3, 2, 1].forEach(function(x) {
|
||||
new AsyncFunction(function() {
|
||||
sleep(x * 1000);
|
||||
}).run();
|
||||
});
|
||||
function main(args) {
|
||||
[5, 4, 3, 2, 1].forEach(function(x) {
|
||||
new AsyncFunction(function() {
|
||||
sleep(x * 1000);
|
||||
}).run();
|
||||
});
|
||||
}
|
||||
|
||||
exports.main = main;
|
||||
```
|
||||
|
|
Loading…
Reference in New Issue
Block a user