doc_worker.html 644 B

123456789101112131415161718192021222324252627282930
  1. <!-- Any copyright is dedicated to the Public Domain.
  2. http://creativecommons.org/publicdomain/zero/1.0/ -->
  3. <!doctype html>
  4. <html>
  5. <head>
  6. <meta charset="utf-8"/>
  7. <title>Performance test page</title>
  8. </head>
  9. <body>
  10. <script type="text/javascript">
  11. "use strict";
  12. /* exported performWork */
  13. function performWork() {
  14. const worker = new Worker("js_simpleWorker.js");
  15. worker.addEventListener("message", function (e) {
  16. console.log(e.data);
  17. console.timeStamp("Done");
  18. }, false);
  19. worker.postMessage("Hello World");
  20. }
  21. </script>
  22. </body>
  23. </html>