When computing the time of execution of a task using this code:

start_time = time.time()

task()

end_time = time.time()

print "task time=", end_time - start_time

I got random values of time at each re-execution of the code!!!!! Even the task does not change, but every time when I execute the program I got a value which is not the same!!!! Sometimes even an important difference !!!

Now, when testing if parallel processes (multiprocessing package) will reduce the time compared to serial ones this will be very hard to check because really the time varies at every new execution of the program

!!!!!

Can anyone propose or explain that??? and how to check the time of execution of the task or of a process??

Similar questions and discussions