Guest User

Untitled

a guest
Jun 13th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. var count = 0,
  2. running = false,
  3. iface = {};
  4.  
  5.  
  6. iface.run = function ()
  7. {
  8. running = true;
  9. while (running) {
  10. count++;
  11. }
  12. };
  13.  
  14.  
  15. iface.stop = function ()
  16. {
  17. running = false;
  18. };
  19.  
  20.  
  21. onmessage = function (ev)
  22. {
  23. var func_name = ev.data;
  24. iface[func_name].apply();
  25. };
Add Comment
Please, Sign In to add comment