Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * startWatching() is the top level function to begin
- * the contract event watching
- */
- async function startWatching() {
- let watching = true;
- while (watching) {
- await watchEvents();
- wait(5000);
- }
- }
- /**
- * wait() will consecutively wait corresponding time given
- * rather than putting the code to sleep
- *
- * @param ms {Int} Amount of ms to wait
- */
- function wait(ms){
- var start = new Date().getTime();
- var end = start;
- while(end < start + ms) {
- end = new Date().getTime();
- }
- }
Add Comment
Please, Sign In to add comment