<gh_stars>0
from multiprocessing import Process, cpu_count
import time
import os

from threading import Thread


class MuchCPU(Process):
# class MuchCPU(Thread):
    def run(self):
        print(os.getpid())
        for i in range(200000000):
            pass


if __name__ == "__main__":
    print(cpu_count())
    procs = [MuchCPU() for f in range(cpu_count())]
    t = time.time()
    for p in procs:
        p.start()
    for p in procs:
        p.join()
    print("work took {} seconds".format(time.time() - t))


from multiprocessing import Process, cpu_count
import time
import os

from threading import Thread


class MuchCPU(Process):
# class MuchCPU(Thread):
    def run(self):
        print(os.getpid())
        for i in range(200000000):
            pass


if __name__ == "__main__":
    print(cpu_count())
    procs = [MuchCPU() for f in range(cpu_count())]
    t = time.time()
    for p in procs:
        p.start()
    for p in procs:
        p.join()
    print("work took {} seconds".format(time.time() - t))
# class MuchCPU(Thread):