Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Sends a message once a second 10 times
- var app = function(request) {
- return function(responder) {
- var i = 0;
- var w = responder(200, {});
- var intervalId = serInterval(function(){
- w.write("Every second another message");
- if (++i == 10) {
- w.close();
- clearInterval(intervalId);
- }
- }, 1000);
- };
- }
Add Comment
Please, Sign In to add comment