Skip to content

Instantly share code, notes, and snippets.

@jyotendra
Created April 7, 2018 09:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jyotendra/f820de71e8441430ef694f2c8dbae13f to your computer and use it in GitHub Desktop.
Save jyotendra/f820de71e8441430ef694f2c8dbae13f to your computer and use it in GitHub Desktop.
Gist to demonstrate web workers
onmessage = function(e) {
console.log('Message received from main script');
var workerResult = 'Result: ' + (e.data[0] * e.data[1]);
console.log('Posting message back to main script');
postMessage(workerResult);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment