Frontend Labs
⋯

public/js/workers/primes.js

// A module worker (§38): same function, different thread.
import { countPrimes } from "../lib/primes.js";

self.onmessage = ({ data: { limit } }) => {
  const t0 = performance.now();
  const count = countPrimes(limit);
  self.postMessage({ count, ms: performance.now() - t0 });
};

Generated from SOURCE.md · 8 Oct 2026 16:36