This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const wrapGenerator = function (Generator) { | |
const promise = new Promise(function (resolve, reject) { | |
const g = Generator() | |
let r = g.next() | |
const nextYield = function (r) { | |
if (r.done == true) { | |
resolve(r.value) | |
return | |
} | |
r.value.then(function (x) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
/** | |
* Created by zyf on 17-4-19. | |
*/ | |
let i; | |
let times = 10, | |
delay = 100; | |
let startTime, lastTime, now, durations; | |
const workNum = 100000; |
NewerOlder