Page 88 - Nodejs 교과서 개정2판
P. 88

• setInterval(콜백	함수,	밀리초)  ઱য૓ ޻ܻୡ݃׮ ௒ߔ ೣࣻܳ ߈ࠂ प೯೤פ׮

            • setImmediate(콜백	함수)  ௒ߔ ೣࣻܳ ૊द प೯೤פ׮
          
         ੉ ఋ੉ݠ ೣٜࣻ਷ ݽف ই੉٣ܳ ߈ജ೤פ׮  ই੉٣ܳ ࢎਊೞৈ ఋ੉ݠܳ ஂࣗೡ ࣻ ੓णפ׮

            • clearTimeout(아이디)  setTimeoutਸ ஂࣗ೤פ׮

            • clearInterval(아이디)  setIntervalਸ ஂࣗ೤פ׮

            • clearImmediate(아이디)  setImmediateܳ ஂࣗ೤פ׮
          
         ׮਺਷ ਤ ݫࢲٜ٘ਸ ࢎਊೠ ௏٘ੑפ׮  ௏٘੄ प೯ ࣽࢲܳ ৘ஏ೧ࠁࣁਃ  ഁтܻب۾ ௏٘ ࣽࢲܳ ࢴয ֬ও
         णפ׮


          timer.js
           const	timeout	=	setTimeout(()	=>	{
           		console.log('1.5초	후	실행');
           },	1500);


           const	interval	=	setInterval(()	=>	{
           		console.log('1초마다	실행');
           },	1000);


           const	timeout2	=	setTimeout(()	=>	{
           		console.log('실행되지	않습니다');
           },	3000);


           setTimeout(()	=>	{
           		clearTimeout(timeout2);
           		clearInterval(interval);
           },	2500);


           const	immediate	=	setImmediate(()	=>	{
           		console.log('즉시	실행');
           });


           const	immediate2	=	setImmediate(()	=>	{
           		console.log('실행되지	않습니다');
           });


           clearImmediate(immediate2);





         ઁੌ ݢ੷ प೯غח Ѫ਷ immediateੑפ׮  immediate2ח ߄۽ clearImmediateܳ ࢎਊ೧ࢲ ஂࣗ೮ਵ޲۽ प
         ೯غ૑ ঋणפ׮  ௏٘ प೯ 1ୡ റীח interval੄ ௒ߔ੉ प೯ؾפ׮  ௏٘ प೯ 1 5ୡ റীח timeout੄ ௒ߔ
   83   84   85   86   87   88   89   90   91   92   93