s
s
snc
Search…
interval
snc.interval(function, end(data))
Execute in time intervals and break with end function.
1
var i = 0
2
snc.interval(2000, end => {
3
console.log(`Executed: ${new Date()}`)
4
i++
5
if (i === 3) end('Bye bye')
6
},
7
res => {
8
console.log(`End: ${res}`)
9
})
Copied!
1
-> Executed: Thu Feb 01 2018 13:54:27 GMT+0100 (CET)
2
-> Executed: Thu Feb 01 2018 13:54:29 GMT+0100 (CET)
3
-> Executed: Thu Feb 01 2018 13:54:31 GMT+0100 (CET)
4
-> Response: "End..."
Copied!
Copy link