doc: add set some time section
This commit is contained in:
1 parent
a45677ff99
commit
9400a61fd5
1 file changed
+9
@@ -94,4 +94,13 @@ verifyPizza();
|
|||||||
eatPizza();
|
eatPizza();
|
||||||
// twiddle thumbs
|
// twiddle thumbs
|
||||||
payForPizza();
|
payForPizza();
|
||||||
|
```
|
||||||
|
# 定时间
|
||||||
|
```javascript
|
||||||
|
function orderExecutor(resolve, reject) { // reject not required here
|
||||||
|
console.log('making our pizza...');
|
||||||
|
setTimeout(resolve, 5000);
|
||||||
|
}
|
||||||
|
let orderPizza = new Promise(orderExecutor);
|
||||||
|
orderPizza.then(function () { console.log('eating pizza!'); });
|
||||||
```
|
```
|
||||||
Reference in new issue
Block a user