You use time.clock , which gave you CPU time, not real-time: you cannot use this in your case, since it gives you runtime (how long did you use the CPU to run your code, which will be almost in one and the same time for each of these cases)
Running the code using time.time() instead of time.clock gave me this time on my computer:
Process : ('Time Taken = ', 5.226783990859985) seq : ('Time Taken = ', 6.3122560000000005) Thread : ('Time Taken = ', 17.10062599182129)
The task given here (printing) is so great that accelerating the use of multiprocessing is almost balanced by costs.
For Threading , since you only have one thread running because of the GIL, you end up performing all your functions sequentially, but you had overhead on the threads (changing threads every few iterations can cost up to several milliseconds each time). This way you get something much slower.
Threading is useful if you have a timeout, so you can run tasks between them.
Multiprocessing is useful for calculating costly tasks, if possible, completely independent (without common variables). If you need to exchange variables, you will have to run into the GIL, and this is a bit more complicated (but not ruled out most of the time).
EDIT: Actually, using time.clock , like you, you provided information on how much overhead Threading and Multiprocessing are using.
source share