1// Flags: --expose-internals 2'use strict'; 3 4const common = require('../common'); 5const assert = require('assert'); 6const { sleep } = require('internal/util'); 7 8let called = false; 9const t1 = setInterval(() => { 10 assert(!called); 11 called = true; 12 setImmediate(common.mustCall(() => { 13 clearInterval(t1); 14 clearInterval(t2); 15 })); 16}, 10); 17 18const t2 = setInterval(() => { 19 sleep(20); 20}, 10); 21