title: Introduce delay in the data emitted by socket
body: <p>I have built socket connection, In which I have a graph in frontEnd. This graph gets updated based on input provided by the user. On the backend I'm emitting data( array of data sent to frontend ). Is it possible to introduce delay between each value of the array emmited by the socket?</p>
  
  <p>I have tried putting the code inside setInterval function, but soon I realised my stupidity. I'm clueless on how to proceed.</p>
  
  <pre><code>io.sockets.on('connection', (socket) =&gt; {
      console.log(`new connection id: ${socket.id}`);
      socket.emit('test event', 'data is getting generated');
      //sendData(socket);
      socket.on('test', data =&gt; {
          console.log("DATA ", data);
          let start = data.start_val;
          const arr = [];
          while (start &lt;= data.end_val) {
              arr.push(start);
              start = start + data.interval;
          }
          model.data.create({
              startvalue: data.start_val,
              endvalue: data.end_val,
              difference: data.interval
  
          });
          socket.emit('response', arr);
      });
  
  })
  </code></pre>
  
  <p>I'm sending 3 values to backend Start_val, end_val and difference. These values are used to generate data. For example - Input:- start_val = 10, end_val = 30, difference = 30. Then the array sent back is [10,20,30]. Now I want to understant if I can provide a time delay of 1 second between each value of the array. i.e 10 should come on the 1st second, 20 should arrive at 2nd second and so on. Any help is deeply appreciated.</p>