Advertisement
karlakmkj

Node.js - timers module

Oct 11th, 2021
1,207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. setTimeout(() => {
  2.   const buffer1 = Buffer.from('Hello');
  3.   const buffer2 = Buffer.from('learner');
  4.   const bufferArray = [buffer1, buffer2];
  5.   const bufferConcat = Buffer.concat(bufferArray);
  6.  
  7.   console.log(bufferConcat.toString());
  8. }, 3000);
  9.  
  10. setImmediate(() => {
  11.   console.log("I got called right away!");
  12. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement