| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 06b1758 commit 7f3a420
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -19,9 +19,13 @@ | |||
| 19 | 19 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE | |
| 20 | 20 | // USE OR OTHER DEALINGS IN THE SOFTWARE. | |
| 21 | 21 | ||
| 22 | + // Flags: --expose-internals --no-warnings | ||
| 23 | + | ||
| 22 | 24 | 'use strict'; | |
| 23 | 25 | require('../common'); | |
| 24 | 26 | const assert = require('assert'); | |
| 27 | + const { internalBinding } = require('internal/test/binding'); | ||
| 28 | + const timersBinding = internalBinding('timers'); | ||
| 25 | 29 | ||
| 26 | 30 | // setImmediate should run clear its queued cbs once per event loop turn | |
| 27 | 31 | // but immediates queued while processing the current queue should happen | |
@@ -38,8 +42,8 @@ const QUEUE = 10; | |||
| 38 | 42 | function run() { | |
| 39 | 43 | if (hit === 0) { | |
| 40 | 44 | setTimeout(() => { ticked = true; }, 1); | |
| 41 | - const now = Date.now(); | ||
| 42 | - while (Date.now() - now < 2); | ||
| 45 | + const now = timersBinding.getLibuvNow(); | ||
| 46 | + while (timersBinding.getLibuvNow() - now < 2); | ||
| 43 | 47 | } | |
| 44 | 48 | ||
| 45 | 49 | if (ticked) return; | |
| Back | FazBrowse Home | New Git URL |
0 commit comments